As noted in the documentation, the ItemCheck event "occurs when the checked state of an item changes." In other words, it's intended to provide information about the checked state of a single item, not the entire list.
Try this:
Code:
Private Sub CListBox1_ItemCheck(ByVal sender As Object, _
ByVal e As System.Windows.Forms.ItemCheckEventArgs) _
Handles CListBox1.ItemCheck
' Display msgbox for previous checked items
For Each itemchecked As Object In CListBox1.CheckedItems
MsgBox(itemchecked)
Next
' If this event is fired because item was checked,
If e.NewValue <> CheckState.Unchecked Then
' Display msgbox for newly-checked item
MsgBox(CListBox1.Items(e.Index))
End If
End Sub
Bookmarks