Checkbox is a control that allow user to get boolean
values from user for a spesific question like "Are you ok?".
Has a event called CheckedChanged
, which occurs whenever the check
property is changed.
Here is a CheckBox that has a question "Is Checked?".
We got this MessageBox
from CheckedChanged
event,
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
bool IsChecked = checkBox1.Checked;
MessageBox.Show(IsChecked.ToString());
}
If CheckBox is checked -> IsChecked
variable will be true
.
If CheckBox is not checked -> IsChecked
variable will be false
.