Form1: public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
} private void button1_Click(object sender, EventArgs e)
{
Form2 f2 = new Form2(this);
f2.MdiParent = this;
f2.Show();
}
}
Form2: public partial class Form2 : Form
{ public Form1 form1 = null; public Form2()
{
InitializeComponent();
} public Form2(Form1 f1)
{
this.form1 = f1;
InitializeComponent();
} private void button1_Click(object sender, EventArgs e)
{
Form2_2 f22 = new Form2_2(form1);
f22.Show();
}
}
Form2-2:public partial class Form2_2 : Form
{ public Form2_2()
{
InitializeComponent();
} public Form2_2(Form1 f1)
{
this.MdiParent = f1;
InitializeComponent();
}
}
{
public Form1()
{
InitializeComponent();
} private void button1_Click(object sender, EventArgs e)
{
Form2 f2 = new Form2(this);
f2.MdiParent = this;
f2.Show();
}
}
Form2: public partial class Form2 : Form
{ public Form1 form1 = null; public Form2()
{
InitializeComponent();
} public Form2(Form1 f1)
{
this.form1 = f1;
InitializeComponent();
} private void button1_Click(object sender, EventArgs e)
{
Form2_2 f22 = new Form2_2(form1);
f22.Show();
}
}
Form2-2:public partial class Form2_2 : Form
{ public Form2_2()
{
InitializeComponent();
} public Form2_2(Form1 f1)
{
this.MdiParent = f1;
InitializeComponent();
}
}
//'this' is Form2
f2_2.MdiParent = this.MdiParent;