Windows Develop Bookmark and Share   
 index > Windows Forms General > Is there something like the listitem class in winforms?
 

Is there something like the listitem class in winforms?

The listitem from asp.net is pretty handy - you can store a "value" and a "text" property in it, and bind it to a listbox etc. Unfortunately, I haven't found something in winforms that does the same. Am I missing something? How to replicate the same behaviour in winforms?
VeryBoringNickname  Tuesday, September 01, 2009 2:06 PM
Nishant Sivakumar  Tuesday, September 01, 2009 2:21 PM
The ListBox.Items collection stores objects. All you have to do is override the ToString() method of the class whose objects you add to the box.

Hans Passant.
nobugz  Tuesday, September 01, 2009 4:58 PM
Nishant Sivakumar  Tuesday, September 01, 2009 2:21 PM
The ListBox.Items collection stores objects. All you have to do is override the ToString() method of the class whose objects you add to the box.

Hans Passant.
nobugz  Tuesday, September 01, 2009 4:58 PM

You can use google to search for other answers

Custom Search

More Threads

• How to format DATE textboxes using CurrentCulture?
• How to invoke onEnter for a Label Control
• Highlight Tree Node
• printwindow form mess-up
• multiple forms
• Adding Components
• Timer help
• MDI Application single child instance problem
• A simple playsound or beep function
• Multi Form application... NOT MDI application