Hi All,
I want to open a Form inside another Form.
at present time both forms are opening seperatly.
How can I open the second Form inside the first Form...
thanx a lot in advance
Open Form inside another Form
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.


VulpesRank #55 · 29.2K reputationPosted Aug 5, 2012, 11:44 AM EDT
Form2 f2 = new Form2();
f2.TopLevel = false;
this.Controls.Add(f2);
f2.Show();
An alternative approach would be to make Form2 an MDI child of Form1. To do this, you first need to set Form1's IsMdiContainer property to true in the Properties Box. The code to open Form2 would then be:
Form2 f2 = new Form2();
f2.MdiParent = this;
f2.Show();
ilhami caliskan79 reputationPosted Aug 5, 2012, 7:47 PM EDT