I have 3 Form. I want to show Form3 and close Form1, Form2 when click button in Form2. This is my code . when I run this code it can show Form3 but not close Form1.
Form1
private void button1_Click(object sender, EventArgs e)
{
Form2 frm2 = new Form2();
frm2.ShowDialog();
//frm2.Show();
}
Form2
private void button1_Click(object sender, EventArgs e)
{
Form3 frm3 = new Form3();
Form1 frm1 = new Form1();
frm3.Show();
frm1.Hide(); // It not close Form1
this.Hide();
// frm1.Close();
// this.Close();
}