World's easiest list box question

G

Guest

From the list box _Click event, how do you find out whether the item that was
clicked has been selected or de-selected?

Private Sub lstMyList_Click()

if lstMyList.???.Selected(???) = True then
...

End Sub
 
D

Dirk Goldgar

Carol Grismore said:
From the list box _Click event, how do you find out whether the item
that was clicked has been selected or de-selected?

Private Sub lstMyList_Click()

if lstMyList.???.Selected(???) = True then
...

End Sub

I had an idea, but I had to check it out. Here:

With Me.lstMyList
If .Selected(.ListIndex) Then
MsgBox "Selected"
Else
MsgBox "Unselected"
End If
End With
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top