Seems, you just want to open child form in this schema:
Form1
has to be a main form.
Form2
,
Form3
, etc.has to be a child form.
The order of opening forms is:
Form1 -> Form2 -> Form3
Every child form constructor has to be changed to:
public Form2(Form ParentForm)
{
InitializeComponent();
this.MdiParent = ParentForm;
}
public Form3(Form ParentForm)
{
InitializeComponent();
this.MdiParent = ParentForm;
}
Usage:
private void button1_Click(object sender, EventArgs e)
{
Form2 form2 = new Form2(this);
form2.Show();
}
private void button1_Click(object sender, EventArgs e)
{
Form3 form3 = new Form3(this.MdiParent);
form3.Show();
}