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.