|
Stephen Woolhead wrote:
Is this normal namespace behaviour?
Yep. Perhaps Eric can explain it better (I just spent 10 minutes trying to and couldn't get it out right) but IIRC namespaces are evaluated from right to left, so the System matches before it gets to the root System namespace; however Diagnostics doesn't match until it gets to the root System namespace.
James
"Java is free - and worth every penny." - Christian Graus
|
|
|
|
|
Just seemed strange to me that as I was in the namespace MyNameSpace.System and had a using statement for System when I was used System.Diagnostics, that it should resolve to MyNameSpace.System.Diagnostics instead of trying the following
MyNameSpace.System.System.Diagnostics (Current namespace)
System.System.Diagnostics (Using System Statement)
System.Diagnostics (using the global namespace)
Of which the last one would have been resolved.
Is there a way to say that this is the start of the namespace do not append to anything, something like ::System in C++ ?
Thanks
Stephen
|
|
|
|
|
Stephen Woolhead wrote:
Just seemed strange to me
It does to me too; perhaps this will be addressed in the future (so that it tries all the way up instead of stopping at the first failure -- MyNameSpace.System.Diagnostics)
Stephen Woolhead wrote:
Is there a way to say that this is the start of the namespace do not append to anything
Not that I know of, I think something is needed at any rate.
James
"Java is free - and worth every penny." - Christian Graus
|
|
|
|
|
Stephen Woolhead wrote:
Is there a way to say that this is the start of the namespace do not append to anything, something like ::System in C++ ?
No but you can try this code example. It's an almost solution to the problem.
using System;
using WinSystem=System;
namespace Test.System {
public class Test {
public static void Main(String[] args) {
WinSystem.Console.WriteLine("Hello World");
}
}
}
Jared
jparsons@jparsons.org
www.prism.gatech.edu/~gte477n
|
|
|
|
|
Hi everybody!
I have the following code in the constructor:
lstUsers = new ListView();<br />
lstUsers.Parent = this;<br />
lstUsers.Location = new Point(0, panelTitle.Height);<br />
lstUsers.Size = new Size(Width, Height - lstUsers.Location.Y + 1);<br />
lstUsers.Anchor = AnchorStyles.Left | AnchorStyles.Top |<br />
AnchorStyles.Right | AnchorStyles.Bottom;<br />
lstUsers.View = View.Details;<br />
<br />
lstUsers.Columns.Add("Clave", 150, HorizontalAlignment.Left);<br />
lstUsers.Columns.Add("Nombre", 250, HorizontalAlignment.Left);<br />
lstUsers.Columns.Add("Permisos", 100, HorizontalAlignment.Right);<br />
The list view appears ok, and when I add items, I can see them in large icon mode (if I remove the View = Details), but in Details mode I don't see anything... not even the column headers (after adding the columns I verified and Columns.Items.Count is indeed 3)
Any ideas???
-- LuisR
──────────────
Luis Alonso Ramos
Chihuahua, Mexico
www.luisalonsoramos.com
"Do not worry about your difficulties in mathematics, I assure you that mine are greater." -- Albert Einstein
|
|
|
|
|
Hi, try adding
listUsers.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
or Clickable.
Hope this helps
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
Sorry, it didn't work
The only one that seemed to have an effect was ColumnHeaderStyle.None, which removed the place where columns are supposed to appear.
Thanks anyway,
-- LuisR
──────────────
Luis Alonso Ramos
Chihuahua, Mexico
www.luisalonsoramos.com
"Do not worry about your difficulties in mathematics, I assure you that mine are greater." -- Albert Einstein
|
|
|
|
|
Luis Alonso Ramos wrote:
The list view appears ok, and when I add items, I can see them in large icon mode (if I remove the View = Details), but in Details mode I don't see anything...
How are u adding the ListViewItems? If u want to see "multi-columns" make sure it looks like this.
listUser.Items.Add( new ListViewItem( new string[] {"col1itemtext","col2itemtext","col3itemtext"}));
and NOT:
listUser.Items.Add( "colitemtext")
Are u not maybe overwriting the columnheaders?
Hope this helps
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
Hello,
<br />
while(oReader.Read())<br />
{<br />
ListViewItem lvi = new ListViewItem();<br />
<br />
lvi.Text = (string) oReader.GetValue(oReader.GetOrdinal("LoginName"));<br />
lvi.SubItems.Add((string) oReader.GetValue(oReader.GetOrdinal("Name")));<br />
lvi.Tag = (int) oReader.GetValue(oReader.GetOrdinal("ID_user"));<br />
<br />
lstUsers.Items.Add(lvi);<br />
}<br />
This is what I'm using... If I set another view (View.List) for example, the items show OK. It's just the details view that I'm having trouble with.
-- LuisR
──────────────
Luis Alonso Ramos
Chihuahua, Mexico
www.luisalonsoramos.com
"Do not worry about your difficulties in mathematics, I assure you that mine are greater." -- Albert Einstein
|
|
|
|
|
Hehe, from what i can see u dont seem to have VS.NET. In the collection editor u can see (and i had a problem here at 1st too ) how the displayed data is laid out. The ListViewItem is also the 1st SubItem. Try this (i asumme an OleDbReader??)
string[] str_arr = new string[3];
str_arr[0] = (string) oReader.GetValue(oReader.GetOrdinal("LoginName"));
str_arr[1] = (string) oReader.GetValue(oReader.GetOrdinal("Name"));
str_arr[2] = oReader.GetValue(oReader.GetOrdinal("ID_user")).ToString();
lstUsers.Items.Add(new ListViewItem( str_arr));
This is a bit tedious though. I would normally create a LVI property on a class needed to be displayed in detail. Then all i do is use the following constructor for my ListViewItem (from MSDN):
Initializes a new instance of the ListViewItem class with an array of strings representing subitems.
public ListViewItem(string[]);
Hope this gets you going
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
leppie wrote:
from what i can see u dont seem to have VS.NET
Yes, I'm using Visual C# .NET. But I'm typing most code manually.
The problem is not adding the items, those are added correctly (I can see them as expected in other Views). What I'm having trouble with is adding the columns. In another form I use a list view also and everything works OK. I copied that exact same code to this panel (it's a Panel control, but the one that works is on a TabPage which is also a Panel) and same problem, no columns show up.
I'll give it a try to your way of adding items, but I don't think that will solve it.
Thanks!
-- LuisR
──────────────
Luis Alonso Ramos
Chihuahua, Mexico
www.luisalonsoramos.com
"Do not worry about your difficulties in mathematics, I assure you that mine are greater." -- Albert Einstein
|
|
|
|
|
I fixed this problem!!!
The problem was I was calling lstView.Clear() and that removes all items AND columns. I now call lstView.Items.Clear() and everything works as it should!
Thanks everyone for your help!
-- LuisR
──────────────
Luis Alonso Ramos
Chihuahua, Mexico
www.luisalonsoramos.com
"Do not worry about your difficulties in mathematics, I assure you that mine are greater." -- Albert Einstein
|
|
|
|
|
Hi,
I need to know, if the tab-key is pressed in a single-line textbox. But if any control in the form has the TabStop-property set to true, there will no event be raised before leaving the control. The only event raised is the KeyUp event of the form, if the KeyPreview is set to true. But when it is raised, the focus is already in the next control.
Does someone know a way to check, if the tab-key is pressed? I thought I could work with the Leave-event, but I don't know, if the control will be left because of the tab-key.
Thank you for your help,
Michael
muenchen-michi@gmx.de
|
|
|
|
|
I'm not sure, but there is an AcceptTab property (and AcceptReturn too, I don't know if it only applies to multiline)... you could try setting that to true and handling KeyDown/KeyUp/KeyPress... then you call SelectNextControl to move the foucs to the next control in the tab order.
-- LuisR
──────────────
Luis Alonso Ramos
Chihuahua, Mexico
www.luisalonsoramos.com
"Do not worry about your difficulties in mathematics, I assure you that mine are greater." -- Albert Einstein
|
|
|
|
|
Hi Luis,
thanks for you answer. But these properties only apply to multiline textboxes. So this won't help me.
Michael
muenchen-michi@gmx.de
|
|
|
|
|
Why would you like to trap the tab key? to be able to prevent the user from tabbing away from your control?? what for? maybe we can find another solution.
-- LuisR
──────────────
Luis Alonso Ramos
Chihuahua, Mexico
www.luisalonsoramos.com
"Do not worry about your difficulties in mathematics, I assure you that mine are greater." -- Albert Einstein
|
|
|
|
|
Hi all
Has anyone a clue how to do or approach this?
If you dont know what I mean, open Word and select some text and click the Highlight Button
Thanking all in advance
Cheers
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
I think that the only way you're going to be able to do this is if you add the code with the rich text format codes applied. You will have to get the text from the box via Rtf. This will give you the text of the box with all of the format codes applied. You can then manually edit it and put in the format codes that you want. However this is a very large pain in the ass.
Jared
jparsons@jparsons.org
www.prism.gatech.edu/~gte477n
|
|
|
|
|
Thx
But SelectedRtf (and Rtf) from a RichTextBox seems to be very picky. I was try just to copy SelectedRtf from one RichTextBox to another and 9/10 times exceptions was thrown.
I will try it though. Maybe it was escaping or something.
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
Hello, I am trying to find out if anyone has a ComboBox Control for Visual Basic .NET that will handle Multi-Columns. Also, I have seen a Drop-Down TreeView Control as well on this site...has anyone Implemented this into .NET yet? I could really use both of these ASAP!
|
|
|
|
|
The TreeView control can be downloaded at www.asp.net. It is part of the IEWebControls package. As for the other, I haven't seen one yet...
David Stone
dstone@newcenturytitle.com
Procrastination is like masturbation; it's all good until you realize you just screwed yourself.
-Writing on a bench at college
|
|
|
|
|
I am developing an eShop with ASP.NET and my IDE is Visual Studio .NET. I want to use Cookie to keep Shop Cart information at client side. I also defined a class and some functions to work with them, for example adding an item to Cookie (Shop Cart), updating items and deleting an item.
But when I use these functions, no changes apply to the cookie value.
I think it is because the class doesn't have access to change Response and Request of Page.
Please let me know how I can solve this problem.
Here is the code I developed (Unnecessary parts are not shown.)
C# Class:
public class ShopCart
{
/*
...
*/
/******************** Cookie Remove_Name ******************/
// Removes an Item from Cookie
public void Remove_Name(HttpRequest thisReq, String Cookie_Name, String sName)
{
HttpCookieCollection MyCookieColl;
HttpCookie MyCookie;
MyCookieColl = thisReq.Cookies;
MyCookie = MyCookieColl[Cookie_Name];
if (MyCookie!=null)
{
if (MyCookie.Values.Get(sName)!=null)
{
MyCookie.Values.Remove(sName);
Response.Cookies.Add(MyCookie);
}
}
}
} // class
ASP.NET Call script:
ShopCart myShopCart = new ShopCarts.ShopCart();
myShopCart.Remove_Name(Request, "eShopCart", "item_01"
Look forward to hearing from you all.
Sassan
|
|
|
|
|
Hi Guys,
I have a method that does multiple updates(hundreds of them) into SQL server.The data is in the form of array of objects . Now i'm looping through them and updating them one at a time .This is taking much time .Is there an efficient way of doing this?
Thanks in advance
sarith sutha
|
|
|
|
|
Sarith,
can you give me an example of one object in your array?
Maybe a code snippet.
Cheers,
Simon
"Sign up for a chance to be among the first to experience the wrath of the gods.", Microsoft's home page (24/06/2002)
|
|
|
|
|
i hope this will do
for(int index = 0 ; index < TaskItems.Length ; index++)
{
piSqlStmt=new StringBuilder("INSERT INTO Tasks (Task_id,Task_Desc,Task_status) VALUES";
piSqlStmt.Append("'"+TaskItems[index].Task_id+"'");
piSqlStmt.Append(",'"+TaskItems[index].Task_Desc+"'");
piSqlStmt.Append(",'"+TaskItems[index].Task_status+"'");
piSqlCommand.CommandText = piSqlStmt.ToString();
piSqlCommand.ExecuteNonQuery();
}
sarith sutha
|
|
|
|