If I understand what you're aslking...
collection is a collection of type
, you don't have to cast the object when you add it to the
. Just add this method to your item class:
public override string ToString()
Now, you can simply add your items to the listbox, and the listbox will use whatever is returned by
for displaying the items.
When you use ListBox.SelectedItem, you will need to cast that to the appropriate type (in your case,
TorpedoSvcProvider selected = listBox1.SelectedItem as TorpedoSvcProvider;