By submitting your personal information, you agree that TechTarget and its partners may contact you regarding relevant content, products and special offers.
Private Sub Form1_Load(ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles MyBase.Load CheckedListBox1.Items.Add("First", True) CheckedListBox1.Items.Add("Second", True) CheckedListBox1.Items.Add("Third", True) End Sub Private Sub Button3_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles Button3.Click ' Get the selected item index. Dim sel As Integer = CheckedListBox1.SelectedIndex If (sel <> -1) Then ' Get the selected item's check state. Dim chkstate As CheckState chkstate = CheckedListBox1.GetItemCheckState(sel) ' Toggle the item state. If (chkstate = CheckState.Checked) Then chkstate = CheckState.Unchecked Else chkstate = CheckState.Checked End If ' Set the new state. CheckedListBox1.SetItemCheckState(sel, chkstate) End If End Sub
Dig Deeper on Win Development Resources
Related Q&A from John Robbins
What is a JAD session? This term is referred to often in job postings and seems like some kind of brainstorm you carry out with a client to define IT...continue reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.