public partial class Form1 : Form
// Acquire the state of the CheckBox.
CheckState state = checkBox1.CheckState;
// Demonstrate how the CheckBox can be switched upon.switch (state)
// Tell if the box is checked.
CheckChanged. Typically, the CheckBox control is used alongside other controls. The CheckBox state is read when a user performs an action on another control, such as a button.
However The most useful event is probably CheckChanged—this event fires when the user clicks or changes the CheckBox.
And You can add the CheckChanged event handler by clicking on the lightning bolt and double-clicking on the CheckChanged name.
Summary. The CheckBox is useful control in Windows Forms. But it is not often a major focus of applications. It is instead a small, supporting control used with other controls.