Answer the question
In order to leave comments, you need to log in
How to hide form, Hide and Opacity not working?
How to hide form, Hide and Opacity not working?
The code itself:
Form1 Otris = new Form1(Cursor.Position.ToString());
if (checkBox1.Checked == true)
{
checkBox1.ForeColor = Color.FromArgb(188, 87, 206);
Otris.Show();
}
else
{
checkBox1.ForeColor = Color.FromArgb(87, 184, 206);
Otris.Hide();
Otris.Opacity = 0;
}
Answer the question
In order to leave comments, you need to log in
If all this code is written in the checkbox state change handling, then the problem is obvious: you always have a new form created.
The link to the open and displayed form must be kept outside the method and hidden.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question