This is driving me nuts, I've a Multiple selection listbox in my application, after pressing a button the code is supposed to check what items I selected, the first item always come selected.
Now, if I select other items and unselect the first one the code will say that the first item is selected and will not check for the others, if I leave the first item selected the code will check for the other items.
The code I use to check what items are selected is
What's wrong with this? how can I make this code to evaluate what items I selected the correct way???? why if I check other items will say that the first one is selected??? if I select the first one will check the other items???
Now, if I select other items and unselect the first one the code will say that the first item is selected and will not check for the others, if I leave the first item selected the code will check for the other items.
The code I use to check what items are selected is
Code:
Dim li As ListItem
For Each li In LbRoles.Items
If li.Selected = True Then
Roles += li.Value.ToString & ","
End If
Next
What's wrong with this? how can I make this code to evaluate what items I selected the correct way???? why if I check other items will say that the first one is selected??? if I select the first one will check the other items???