Export (0) Print
Expand All
Expand Minimize

Form.LayoutMdi Method

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

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)

public void LayoutMdi (
	MdiLayout value
)
public void LayoutMdi (
	MdiLayout value
)
public function LayoutMdi (
	value : MdiLayout
)

Parameters

value

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

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.

The following code 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.

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 );
 }
    

public void HorizontallyTileMyWindows(Object sender, System.EventArgs e)
{
    // Tile all child forms horizontally.
    this.LayoutMdi(MdiLayout.TileHorizontal);
} //HorizontallyTileMyWindows

public void VerticallyTileMyWindows(Object sender, System.EventArgs e)
{
    // Tile all child forms vertically.
    this.LayoutMdi(MdiLayout.TileVertical);
} //VerticallyTileMyWindows

public void CascadeMyWindows(Object sender, System.EventArgs e)
{
    // Cascade all MDI child windows.
    this.LayoutMdi(MdiLayout.Cascade);
} //CascadeMyWindows

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft