L
LarryMac
This is sort of a newbie question, but it's making me crazy.
I have a project (VB.Net) in which data is read from a source file.
That data is used to create instances of the class "OrderItem" and a
list box (Supplies) is populated with those items. This part works.
If the user double-clicks an item on the list box, it checks to see if
that item appears on another list box (On Order) to see if it has
already been ordered.
Normally, I just cast the item on the list as a string
(CStr(lstSupplies.Items(lstSupplies.SelectedIndex)) and search the
other list box for it, but this time I can't seem to cast an
"OrderItem" as a "String". I'm assuming it's because my collection is
objects and not just text strings, but I can't seem to come up with a
workaround. BTW, items are listed (sorted) by their description via a
ToString function within the class.
Any and all help is appreciated.
I have a project (VB.Net) in which data is read from a source file.
That data is used to create instances of the class "OrderItem" and a
list box (Supplies) is populated with those items. This part works.
If the user double-clicks an item on the list box, it checks to see if
that item appears on another list box (On Order) to see if it has
already been ordered.
Normally, I just cast the item on the list as a string
(CStr(lstSupplies.Items(lstSupplies.SelectedIndex)) and search the
other list box for it, but this time I can't seem to cast an
"OrderItem" as a "String". I'm assuming it's because my collection is
objects and not just text strings, but I can't seem to come up with a
workaround. BTW, items are listed (sorted) by their description via a
ToString function within the class.
Any and all help is appreciated.