How to add a MDI Child from another MDIChild
3 Sep 2020 / 1 minute to read
You should set the MDIParent of the new child form as follows:
private void buttonAdv1_Click(object sender, System.EventArgs e)
{
Form3 child1 = new Form3();
// Set the new form's MDIParent to the main form.
child1.MdiParent = (Form1) this.Parent.Parent;
child1.Text = "Document";
child1.Show();
}
Private Sub buttonAdv1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles buttonAdv1.Click
Dim f1 As Form3 = New Form3()
' Set the new form's MDIParent to the main form.
f1.MdiParent = CType(Me.Parent.Parent, Form1)
f1.Text = "Document"
f1.Show()
End Sub
Was this page helpful?
Yes
No
Thank you for your feedback!
Thank you for your feedback and comments. We will rectify this as soon as possible!
An unknown error has occurred. Please try again.
Help us improve this page