Q:

Double-click event on GroupBox

I was trying to select all checkboxes when the groupbox is double-clicked, since it's simple it was quick but now I want to unselect all the checkboxes when the groupbox is double clicked again, here's what I have:
Private Sub GroupBox1_DoubleClick(sender As System.Object, _
    e As System.EventArgs) Handles GroupBox1.DoubleClick
    CheckBox1.Checked = True : CheckBox2.Checked = True
    CheckBox3.Checked = True : CheckBox4.Checked = True
    CheckBox5.Checked = True : CheckBox6.Checked = True
End Sub

(Yea I don't use checked listbox)
So, how can I make that happen?

A:

The Checked property is a boolean value, so you could apply the boolean Not operator to invert the current value of the Checked property
Private Sub GroupBox1_DoubleClick(sender As System.Object, e As System.EventArgs) Handles GroupBox1.DoubleClick
    CheckBox1.Checked = Not CheckBox1.Checked 
    CheckBox2.Checked = Not CheckBox2.Checked 
    CheckBox3.Checked = Not CheckBox3.Checked  
    CheckBox4.Checked = Not CheckBox4.Checked 
    CheckBox5.Checked = Not CheckBox5.Checked 
    CheckBox6.Checked = Not CheckBox6.Checked 
End Sub

