Thingol
Technical User
- Jan 2, 2002
- 169
Hi all,
I have a listbox with the multiple selections option set to extended. I need to know the listindex for each selected item. I think I need to do something with the itemsselected property of the listbox, but I'm not sure how to do it. This is the code I have now:
As you can see, I'm trying to use the listindex property to find the index of each item in the selection. It always returns the same row in the list. How can I get the index of each of the selected items in the list?
Best regards,
Martijn Senden.
In the Beginning there was nothing, which exploded.
--Terry Pratchett, Lords and Ladies--
I have a listbox with the multiple selections option set to extended. I need to know the listindex for each selected item. I think I need to do something with the itemsselected property of the listbox, but I'm not sure how to do it. This is the code I have now:
Code:
intTeller = 0
For Each itm In Me.lstGroepen.ItemsSelected
'MsgBox (Me.lstGroepen.ListIndex)
intTeller2 = Me.lstGroepen.ListIndex
intGroepID(intTeller) = ctl.ItemData(itm)
strGroepNaam(intTeller) = ctl.Column(0, intTeller4(intTeller))
intTeller = intTeller + 1
Next itm
As you can see, I'm trying to use the listindex property to find the index of each item in the selection. It always returns the same row in the list. How can I get the index of each of the selected items in the list?
Best regards,
Martijn Senden.
In the Beginning there was nothing, which exploded.
--Terry Pratchett, Lords and Ladies--