I am trying to capture when an item in the CheckedListBox occurs.
I am using the event:
CheckedListBox1_ItemCheck(ByVal sender As Object, ByVal e As
System.Windows.Forms.ItemCheckEventArgs) Handles CheckedListBox.ItemCheck
However, this fires before the item is actually checked. So to get over this
problem I tried:
If e.CurrentValue = CheckState.Unchecked Then
e.NewValue = CheckState.Checked
Else
e.NewValue = CheckState.UnChecked
End If
However, setting the e.NewValue doesn't actually seem to change the checked
state (I'm not really sure what it does do!)
I then tried:
If e.CurrentValue = CheckState.Unchecked Then
CheckedListBox.Checked(e.Index,True)
Else
CheckedListBox.SetItemChecked(e.Index, False)
End If
However, this obviously then fires the event again and the who thing goes
into loop.
Does anyone know a way round this?
-Jerry