Form.LayoutMdi(MdiLayout) Method

Definition

Arranges the multiple-document interface (MDI) child forms within the MDI parent form.

C#
public void LayoutMdi (System.Windows.Forms.MdiLayout value);

Parameters

value
MdiLayout

One of the MdiLayout values that defines the layout of MDI child forms.

Examples

The following example shows the event handlers for the menu items of a Window menu in an MDI application's parent form. Each event handler makes calls to the LayoutMdi method to arrange any child forms that are currently open in the application.

C#
private void HorizontallyTileMyWindows (object sender, System.EventArgs e)
 {
    // Tile all child forms horizontally.
    this.LayoutMdi( MdiLayout.TileHorizontal );
 }
 
 private void VerticallyTileMyWindows (object sender, System.EventArgs e)
 {
    // Tile all child forms vertically.
    this.LayoutMdi( MdiLayout.TileVertical );
 }
 
 private void CascadeMyWindows (object sender, System.EventArgs e)
 {
    // Cascade all MDI child windows.
    this.LayoutMdi( MdiLayout.Cascade );
 }

Remarks

You can use this method to arrange the MDI child forms in your MDI parent form to allow for easier navigation and manipulation of MDI child forms. MDI child forms can be tiled horizontally and vertically, cascaded, or as icons within the MDI parent form.

Applies to

Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

See also