Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror
×
User Journal

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.

This discussion has been archived. No new comments can be posted.

CheckedListBox that only allows one check at a time

Comments Filter:

It has just been discovered that research causes cancer in rats.

Working...