Opening a child form from another child form and set MDI to parent form - how to do?

Try assigning the parent form of your first child from:

Form2 f2 = new Form2;
f2.MdiParent = this.ParentForm; //this refers to f1's parent, the MainForm
f2.Show();

Hope this helps.


Let us suppose that the second form is f2.Then, the code in form f1 to create a new form f2 in MDI parent form will be:

Form2 f2 = new Form2;
f2.MdiParent = this.MdiParent;
f2.Show();

Well, not to argue with the "solution" that was listed... but if I'm understanding the request correctly and trying the above solution didnt work i would do the following....

Form2 f2 = new Form2();
        f2.MdiParent = MDIParent1.ActiveForm;
        f2.Show();