I have a listbox on a Windows form and it is bound using the following code:
objListBox.Data Source = tbl
objListBox.Disp layMember = "ContactNam e"
objListBox.Valu eMember = "ContactID"
------------------------------------
On my form, I have a multi-select listbox and I would like to select a few
items. So If my listbox contains: CA, NV, OR, WA, AZ
and I choose CA and NV,
How can I get get those items?
I tried something like
dim itm as object
for each itm in objlistbox.sele cteditems
console.writeli ne(itm)
next
but it doesn't work. Why is this so hard to get the selected items in a
listbox?
Thanks
objListBox.Data Source = tbl
objListBox.Disp layMember = "ContactNam e"
objListBox.Valu eMember = "ContactID"
------------------------------------
On my form, I have a multi-select listbox and I would like to select a few
items. So If my listbox contains: CA, NV, OR, WA, AZ
and I choose CA and NV,
How can I get get those items?
I tried something like
dim itm as object
for each itm in objlistbox.sele cteditems
console.writeli ne(itm)
next
but it doesn't work. Why is this so hard to get the selected items in a
listbox?
Thanks
Comment