Private Sub chk_crimeName_ItemCheck(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ItemCheckEventArgs) Handles chk_crimeName.ItemCheck
If e.Index = 0 Then
If e.NewValue = CheckState.Checked Then
For i As Integer = 1 To chk_crimeName.Items.Count - 1
chk_crimeName.SetItemCheckState(i, CheckState.Checked)
Next
ElseIf e.NewValue = CheckState.Unchecked Then
For i As Integer = 1 To chk_crimeName.Items.Count - 1
chk_crimeName.SetItemCheckState(i, CheckState.Unchecked)
Next
End If
End If
End Sub
Select/UnSelect item of Listbox select On checkboxlist
Dim item1 As String = chk_district.SelectedIndex
If e.NewValue = CheckState.Checked Then
ListBox1.SelectedIndex = e.Index
Else
ListBox1.SetSelected(e.Index, False)
End If
If e.Index = 0 Then
If e.NewValue = CheckState.Checked Then
For i As Integer = 1 To chk_crimeName.Items.Count - 1
chk_crimeName.SetItemCheckState(i, CheckState.Checked)
Next
ElseIf e.NewValue = CheckState.Unchecked Then
For i As Integer = 1 To chk_crimeName.Items.Count - 1
chk_crimeName.SetItemCheckState(i, CheckState.Unchecked)
Next
End If
End If
End Sub
Select/UnSelect item of Listbox select On checkboxlist
Dim item1 As String = chk_district.SelectedIndex
If e.NewValue = CheckState.Checked Then
ListBox1.SelectedIndex = e.Index
Else
ListBox1.SetSelected(e.Index, False)
End If