Answer the question
In order to leave comments, you need to log in
How to use CheckBox in WinForms?
I want to make it so that when the checkbox is checked, the user has the opportunity to stretch the window (by default, this option is not available, it was done on purpose).
How many in the internet did not climb - could not find the answer.
Maybe someone here can help? Show how this can be done.
Answer the question
In order to leave comments, you need to log in
For Checkbox there is an event - CheckedChanged that occurs when the state of the Checkbox changes.
In it, do what you need.
Handle click on checkbox
private void checkBox1_Click(object sender, System.EventArgs e)
{
// The CheckBox control's Text property is changed each time the
// control is clicked, indicating a checked or unchecked state.
if (checkBox1.Checked)
{
checkBox1.Text = "Checked";
}
else
{
checkBox1.Text = "Unchecked";
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question