共用方式為


Form.LayoutMdi(MdiLayout) 方法

定義

在 MDI 父表單內排列多重文件介面 (MDI) 子表單。

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 值,定義 MDI 子表單的配置。

範例

下列範例顯示 MDI 應用程式父表單中視窗功能表功能表之功能表項目的事件處理常式。 每個事件處理常式都會 LayoutMdi 呼叫 方法,以排列應用程式中目前開啟的任何子表單。

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


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


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

備註

您可以使用這個方法來排列 MDI 父表單中的 MDI 子表單,以方便流覽及操作 MDI 子表單。 MDI 子表單可以水準和垂直、串聯或做為 MDI 父表單內的圖示來並排。

適用於

另請參閱