G
Guest
I've added objects to a listbox using
lst.DisplayMember = "CustomerName"
lst.Items.Add(New CCustomer( theData("ID"), theData("CustomerName")))
if I used lst.SelectedIndex I always get the last item in the list irrespective of whether it was selected. So I thought perhaps I should be using the SelectedObjectCollection.
I can't figure out how to use it, can someone show me some example code
I was thinking
for each obj in lst.SelectedObjectCollection
but the compiler doesnt like this it says
"SelectedObjectCollection is a type and cannot be used in an expression"
Thanks
lst.DisplayMember = "CustomerName"
lst.Items.Add(New CCustomer( theData("ID"), theData("CustomerName")))
if I used lst.SelectedIndex I always get the last item in the list irrespective of whether it was selected. So I thought perhaps I should be using the SelectedObjectCollection.
I can't figure out how to use it, can someone show me some example code
I was thinking
for each obj in lst.SelectedObjectCollection
but the compiler doesnt like this it says
"SelectedObjectCollection is a type and cannot be used in an expression"
Thanks