Form.MdiParent Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Gets or sets the current multiple-document interface (MDI) parent form of this form.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public Form MdiParent { get; set; }

Property Value

Type: System.Windows.Forms.Form

A Form that represents the MDI parent form.

Exception Condition

The Form assigned to this property is not marked as an MDI container.


The Form assigned to this property is both a child and an MDI container form.


The Form assigned to this property is located on a different thread.

To create an MDI child form, assign the Form that will be the MDI parent form to the MdiParent property of the child form. You can use this property from an MDI child form to obtain global information that all child forms need or to invoke methods that perform actions to all child forms.


If there are two MenuStrip controls on an MDI child form, setting IsMdiContainer to true for the parent form merges the contents of only one of the MenuStrip controls. Use Merge to merge the contents of additional child MenuStrip controls on the MDI parent form.

The following code example demonstrates how to create child forms in an MDI application. The example code creates a form with unique text to identify the child form. The example uses the MdiParent property to specify that a form is a child form. This example requires that the code in the example is called from a form that has its IsMdiContainer property set to true and that the form has a private class level integer variable named childCount.

private void CreateMyChildForm ()
   // Create a new form to represent the child form.
   Form child = new Form();
   // Increment the private child count.
   // Set the text of the child form using the count of child forms.
   String formText = "Child " + childCount;
   child.Text = formText;

   // Make the new form a child form.
   child.MdiParent = this;
   // Display the child form.


for requesting a form. Associated enumeration: UIPermissionWindow.AllWindows.

.NET Framework
Available since 1.1
Return to top