How can I trigger the ItemCheck Method of a
ListBox ONLY if a box is checked (and not if a
a box is unchecked also)?
Printable View
How can I trigger the ItemCheck Method of a
ListBox ONLY if a box is checked (and not if a
a box is unchecked also)?
First of all, it is an Event, not a Method. :rolleyes:
Secondly, you can't force the ListBox to raise the event in a different manner.
But, when the event is raised, you can check if the box is checked or not, using the Selected property.
Try this:
Code:Private Sub MyListBox_ItemCheck(Item As Integer)
' Is the box checked? If not, exit the event
If Not MyListBox.Selected(Item) Then Exit Sub
' If this line is reached, then the box is checked
' Put more code here!
End Sub