ListItem namespace/ref

G

Guest

Hi all,
I am using VS 2005 Beta 2. Which assembly (namespace?) should I use for the
ListItem class? I don't have the Help files installed on my notebook for
space reasons; I use MSDN2 online instead. I see ListItem as derived from
System.Web.UI.Controls namespace. Am I missing something here? I am
creating a Windows application by the way.
 
N

Nicholas Paldino [.NET/C# MVP]

Amil,

It's in the System.Web.UI.WebControls namespace.

Hope this helps.
 
N

Nicholas Paldino [.NET/C# MVP]

Amil,

Wait, how come you are using web controls for a windows project?

Are you sure you don't want the ListViewItem class in the
System.Windows.Forms namespace?
 
G

Guest

I am using a ListBox control.

Nicholas Paldino said:
Amil,

Wait, how come you are using web controls for a windows project?

Are you sure you don't want the ListViewItem class in the
System.Windows.Forms namespace?


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Amil said:
Hi all,
I am using VS 2005 Beta 2. Which assembly (namespace?) should I use for
the
ListItem class? I don't have the Help files installed on my notebook for
space reasons; I use MSDN2 online instead. I see ListItem as derived from
System.Web.UI.Controls namespace. Am I missing something here? I am
creating a Windows application by the way.
 
N

Nicholas Paldino [.NET/C# MVP]

Amil,

If that is the case, then you can add anything as an item to the
control. The ToString method is called on the item, and that is used to
populate the list.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Amil said:
I am using a ListBox control.

Nicholas Paldino said:
Amil,

Wait, how come you are using web controls for a windows project?

Are you sure you don't want the ListViewItem class in the
System.Windows.Forms namespace?


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Amil said:
Hi all,
I am using VS 2005 Beta 2. Which assembly (namespace?) should I use
for
the
ListItem class? I don't have the Help files installed on my notebook
for
space reasons; I use MSDN2 online instead. I see ListItem as derived
from
System.Web.UI.Controls namespace. Am I missing something here? I am
creating a Windows application by the way.
 
G

Guest

Thanks Nicholas.

My problem really is how to evaluate the text of the selected item of the
listbox. It seems that I have to include the System.Web.UI.WebControls
namespace in my windows form, which kind of doesn't make sense, to be able to
create a ListItem object. An item in a ListBox evaluates to a ListItem
object, correct?


Nicholas Paldino said:
Amil,

If that is the case, then you can add anything as an item to the
control. The ToString method is called on the item, and that is used to
populate the list.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Amil said:
I am using a ListBox control.

Nicholas Paldino said:
Amil,

Wait, how come you are using web controls for a windows project?

Are you sure you don't want the ListViewItem class in the
System.Windows.Forms namespace?


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Hi all,
I am using VS 2005 Beta 2. Which assembly (namespace?) should I use
for
the
ListItem class? I don't have the Help files installed on my notebook
for
space reasons; I use MSDN2 online instead. I see ListItem as derived
from
System.Web.UI.Controls namespace. Am I missing something here? I am
creating a Windows application by the way.
 
N

Nicholas Paldino [.NET/C# MVP]

Amil,

No, an item in the ListBox for Windows Forms does not evaluate to a
ListItem. It evaluates to object. You can store an object of any type in a
ListBox control for Windows Forms.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Amil said:
Thanks Nicholas.

My problem really is how to evaluate the text of the selected item of the
listbox. It seems that I have to include the System.Web.UI.WebControls
namespace in my windows form, which kind of doesn't make sense, to be able
to
create a ListItem object. An item in a ListBox evaluates to a ListItem
object, correct?


Nicholas Paldino said:
Amil,

If that is the case, then you can add anything as an item to the
control. The ToString method is called on the item, and that is used to
populate the list.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Amil said:
I am using a ListBox control.

:

Amil,

Wait, how come you are using web controls for a windows project?

Are you sure you don't want the ListViewItem class in the
System.Windows.Forms namespace?


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Hi all,
I am using VS 2005 Beta 2. Which assembly (namespace?) should I use
for
the
ListItem class? I don't have the Help files installed on my
notebook
for
space reasons; I use MSDN2 online instead. I see ListItem as
derived
from
System.Web.UI.Controls namespace. Am I missing something here? I
am
creating a Windows application by the way.
 
G

Guest

Ok. Got it. Thanks.

Nicholas Paldino said:
Amil,

No, an item in the ListBox for Windows Forms does not evaluate to a
ListItem. It evaluates to object. You can store an object of any type in a
ListBox control for Windows Forms.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Amil said:
Thanks Nicholas.

My problem really is how to evaluate the text of the selected item of the
listbox. It seems that I have to include the System.Web.UI.WebControls
namespace in my windows form, which kind of doesn't make sense, to be able
to
create a ListItem object. An item in a ListBox evaluates to a ListItem
object, correct?


Nicholas Paldino said:
Amil,

If that is the case, then you can add anything as an item to the
control. The ToString method is called on the item, and that is used to
populate the list.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

I am using a ListBox control.

:

Amil,

Wait, how come you are using web controls for a windows project?

Are you sure you don't want the ListViewItem class in the
System.Windows.Forms namespace?


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Hi all,
I am using VS 2005 Beta 2. Which assembly (namespace?) should I use
for
the
ListItem class? I don't have the Help files installed on my
notebook
for
space reasons; I use MSDN2 online instead. I see ListItem as
derived
from
System.Web.UI.Controls namespace. Am I missing something here? I
am
creating a Windows application by the way.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top