When the checked state of a check box change, I would like to know what the new value is. his is what I am doing:
Friend WithEvents clstTask As System.Windows.Forms.CheckedListBox
Private Sub clstTask_ItemCheck(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ItemCheckEventArgs) Handles clstTask.ItemCheck
Dim SelectedCheckState As CheckState = clstTask.GetItemCheckState(clstTask.SelectedIndex)
End Sub
However, the value of the SelectedCheckState variable is not accuratley reflecting the new state. I think it is showing the current state before the click, as if this were a "Before_CheckChanged" event handler.
The Check box is a 3 state check box, (Checked, UnChecked, Undetermined). Do I have to write ugly code that assumes that if the CheckState returned is state "X" that the CURRENT state must be Y?