Objects to a listbox?

If you override the ToString method on the class in question (assuming you are the one who wrote the class) this method will be called automatically by the listbox to obtain the string to display.

The object itself can then just be added to the listbox via it's Items.Add() method and the SelectedItem property will return the underlying object.
 
Back
Top