Journal SurturZ's Journal: CheckedListBox that only allows one check at a time
Private mblnUpdating As Boolean
Private Sub CheckedListBox1_ItemCheck(ByVal sender As Object, ByVal e As System.Windows.Forms.ItemCheckEventArgs) Handles CheckedListBox1.ItemCheck
Dim clb As CheckedListBox = CType(sender, CheckedListBox)
If e.CurrentValue = CheckState.Unchecked Then
If Not mblnUpdating Then
mblnUpdating = True
For i As Integer = 0 To clb.Items.Count - 1
If i <> e.Index Then
clb.SetItemCheckState(i, CheckState.Unchecked)
End If
Next i
mblnUpdating = False
End If
End If
End Sub
Thanks to http://www.syncfusion.com/faq/windowsforms/faq_c37c.aspx.
CheckedListBox that only allows one check at a time More Login
CheckedListBox that only allows one check at a time
Slashdot Top Deals