Form.LayoutMdi(MdiLayout) Form.LayoutMdi(MdiLayout) Form.LayoutMdi(MdiLayout) Form.LayoutMdi(MdiLayout) Method

定义

在 MDI 父窗体内排列多文档界面 (MDI) 子窗体。Arranges the multiple-document interface (MDI) child forms within the MDI parent form.

public:
 void LayoutMdi(System::Windows::Forms::MdiLayout value);
public void LayoutMdi (System.Windows.Forms.MdiLayout value);
member this.LayoutMdi : System.Windows.Forms.MdiLayout -> unit
Public Sub LayoutMdi (value As MdiLayout)

参数

value
MdiLayout MdiLayout MdiLayout MdiLayout

MdiLayout 值之一,定义 MDI 子窗体的布局。One of the MdiLayout values that defines the layout of MDI child forms.

示例

下面的代码示例显示在 MDI 应用程序的父窗体的窗口菜单的菜单项的事件处理程序。The following code example shows the event handlers for the menu items of a Window menu in an MDI application's parent form. 每个事件处理程序会调用LayoutMdi排列任何子窗体的方法是在应用程序中当前打开。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 );
   }

   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 );
   }
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 );
 }
    
Private Sub HorizontallyTileMyWindows(sender As Object, e As System.EventArgs)
    ' Tile all child forms horizontally.
    Me.LayoutMdi(MdiLayout.TileHorizontal)
End Sub 'HorizontallyTileMyWindows


Private Sub VerticallyTileMyWindows(sender As Object, e As System.EventArgs)
    ' Tile all child forms vertically.
    Me.LayoutMdi(MdiLayout.TileVertical)
End Sub 'VerticallyTileMyWindows


Private Sub CascadeMyWindows(sender As Object, e As System.EventArgs)
    ' Cascade all MDI child windows.
    Me.LayoutMdi(MdiLayout.Cascade)
End Sub 'CascadeMyWindows

注解

此方法可用于在 MDI 父窗体,以便更易于导航和操作的 MDI 子窗体中排列 MDI 子窗体。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 子窗体可以平铺水平、 垂直,级联,或者显示为 MDI 父窗体内的图标。MDI child forms can be tiled horizontally and vertically, cascaded, or as icons within the MDI parent form.

适用于

另请参阅