Hey guys,
I want my form to hide instead to close by clicking on the red X button. Because when it's closed the form is deleted.
I searched a lot to find a good solution, but nothing works.
Many people wrote that following code:
private void Form1_OnClosing(object sender, FormClosingEventArgs e)
{
e.Cancel = true;
this.Hide();
}
would solve the problem. I tried it. My Form is not hiding. I don't know what I did wrong.
I would be very happy if you could help me.
Thanks :)