Let codes tell you how to make this worked:
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
new Form2(this).Show();
}
}
public partial class Form2 : Form
{
Form1 f1;
public Form2(Form1 f)
{
this.f1 = f;
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
f1.Hide();
this.Hide();
new Form3(f1).Show();
}
}
public partial class Form3 : Form
{
Form1 f1;
public Form3(Form1 f1)
{
this.f1 = f1;
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
f1.Close();
}
}