ListBox Selected

  • Thread starter Thread starter Bruce F
  • Start date Start date
B

Bruce F

I have a multiselect ListBox and I want to determine which items are
selected.
I don't want to use "SelectedItems" but want to loop through all items
and check if selected or not.

What I want is:

For i = 0 To ListBox1.Items.Count
' code to check if item(i) is selected
Next

As a Newbie, I am having trouble finding correct code to do this.
 
I dont understand why you arent want to use SelectedItems. There are one or
more indirect ways but in majority they are likely to same.
But altough if you want, you can use this;

for i=0 to listbox1.items.count-1
if listbox1.selecteditems.contains(listbox1.items(i))=true then
'if it is selected
else
' if its not
end if
next

Serkan
 
Back
Top