Form.LayoutMdi Method
Arranges the multiple document interface (MDI) child forms within the MDI parent form.
[Visual Basic] Public Sub LayoutMdi( _ ByVal value As MdiLayout _ ) [C#] public void LayoutMdi( MdiLayout value ); [C++] public: void LayoutMdi( MdiLayout value ); [JScript] public function LayoutMdi( value : MdiLayout );
Parameters
- value
- One of the MdiLayout values that defines the layout of MDI child forms.
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.
Example
[Visual Basic, C#, C++] The following example shows the event-handling methods for the menu items of a Window menu in an MDI application's parent form. Each event-handling method make calls to the LayoutMdi method to arrange any child forms that are currently open in the application.
[Visual Basic] Public Sub HorizontallyTileMyWindows(sender As Object, e As System.EventArgs) ' Tile all child forms horizontally. Me.LayoutMdi(MdiLayout.TileHorizontal) End Sub 'HorizontallyTileMyWindows Public Sub VerticallyTileMyWindows(sender As Object, e As System.EventArgs) ' Tile all child forms vertically. Me.LayoutMdi(MdiLayout.TileVertical) End Sub 'VerticallyTileMyWindows Public Sub CascadeMyWindows(sender As Object, e As System.EventArgs) ' Cascade all MDI child windows. Me.LayoutMdi(MdiLayout.Cascade) End Sub 'CascadeMyWindows [C#] public void HorizontallyTileMyWindows (object sender, System.EventArgs e) { // Tile all child forms horizontally. this.LayoutMdi( MdiLayout.TileHorizontal ); } public void VerticallyTileMyWindows (object sender, System.EventArgs e) { // Tile all child forms vertically. this.LayoutMdi( MdiLayout.TileVertical ); } public void CascadeMyWindows (object sender, System.EventArgs e) { // Cascade all MDI child windows. this.LayoutMdi( MdiLayout.Cascade ); } [C++] public: void HorizontallyTileMyWindows (Object* /*sender*/, System::EventArgs* /*e*/) { // Tile all child forms horizontally. this->LayoutMdi( MdiLayout::TileHorizontal ); } void VerticallyTileMyWindows (Object* /*sender*/, System::EventArgs* /*e*/) { // Tile all child forms vertically. this->LayoutMdi( MdiLayout::TileVertical ); } void CascadeMyWindows (Object* /*sender*/, System::EventArgs* /*e*/) { // Cascade all MDI child windows. this->LayoutMdi( MdiLayout::Cascade ); }
[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button
in the upper-left corner of the page.
Requirements
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
See Also
Form Class | Form Members | System.Windows.Forms Namespace | MdiLayout