Answer the question
In order to leave comments, you need to log in
Why is the form not hidden?
If I register in an event, then nothing happens.
private void Form1_Load(object sender, EventArgs e)
{
Form1 f = new Form1();
f.Hide();
}
public Form1()
{
Form1 f = new Form1();
f.Hide();
}
Answer the question
In order to leave comments, you need to log in
in the first case - you create a new object of type Form1 and hide it. From here, the effect is zero. Those. you created another object and hide it. Not the main form...
in the second case - there is a recursion - i.e. an object (of type Form1) creates itself in the image and likeness of the "original", then the second object creates itself in the image of the "original", etc., until the memory buffer overflows.
To hide the form (the current one in which you are working) it is enoughthis.Hide();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question