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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.