I am trying to click on a button in a form, by doing so it will hide the existing form and show the new one, although I have had problems, and also problems with the forms being “generated” in different locations on the screen!
My code is as follows:
private void button1_Click(object sender, EventArgs e)
{
(new Form3()).Show();
(new Form2()).Hide();
}
This code shows the new form ok, but form2 does not hide
You’re creating a new instance of Form2 and hiding THAT one. I’m guessing you’re looking for this: