You cannot just close the Form1
as it is the main form, but you can hide it. Use this.Hide()
.
private void Check_Click(object sender, EventArgs e)
{
Form2 Check= new Form2();
Check.Show();
Hide();
}
[EDIT]
Not sure if this is what is asked. But...
There are many ways to implement navigation between forms, for example:
In Form1
:
private void button1_Click(object sender, EventArgs e)
{
Form2 form2 = new Form2();
form2.Tag = this;
form2.Show(this);
Hide();
}
In Form2
:
private void button1_Click(object sender, EventArgs e)
{
var form1 = (Form1)Tag;
form1.Show();
Close();
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…