H
Henry Jones
I have a listbox on a Windows form and it is bound using the following code:
objListBox.DataSource = tbl
objListBox.DisplayMember = "ContactName"
objListBox.ValueMember = "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.selecteditems
console.writeline(itm)
next
but it doesn't work. Why is this so hard to get the selected items in a
listbox?
Thanks
objListBox.DataSource = tbl
objListBox.DisplayMember = "ContactName"
objListBox.ValueMember = "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.selecteditems
console.writeline(itm)
next
but it doesn't work. Why is this so hard to get the selected items in a
listbox?
Thanks