Help with checked list box

ProjectMayhem

New member
Joined
Jun 1, 2006
Messages
2
Location
College Station, Texas
Programming Experience
Beginner
I know this is a really simple question, but I just can't seem to find the answer anywhere. I have a checked list box in a vb.net form and I want to perform one action if the user is checking an item from the list, and perform a different action if the user is unchecking an item. How can I test that the current item being selected is already checked or not?

I know the following doesn't work, but I'm looking for something like this:

If clbList.selecteditem.checked = true then
blah blah blah
Else
blah blah blah
End If
 
Nevermind, I figured it out.

For anyone else who may ever be in my situation:

VB.NET:
Expand Collapse Copy
If clbList.CheckedItems.Contains(clbList.SelectedItem) = False Then
MsgBox("something")
Else
MsgBox("something else")
End If
 
Back
Top