If the style is set to checkbox the selected property is the the state of the checkbox. If it is not a checkbox style then the highlighted text is the selected item. Try this code:
Private Sub List1_Click()
Dim iX As Long
For iX = 0 To List1.ListCount - 1
Print List1.Selected(iX)
Next
End Sub
Hope this helps. Anything is possible, the problem is I only have one lifetime.
Thank you Katherine, but I'm using the regular ListBox in VB6, which does not have the SelectedObjectCollection. The CheckedListBox looks interesting, but I have not yet moved to .NET.
Thank you too, Foada. Your succinct answer was helpful. I've noticed that a listbox (with Style=1)item can be selected (highlighted) and/or checked. However, I can't find how to determine which, if any, item is highlighted.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.