Form.LayoutMdi(MdiLayout) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
在 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)
參數
範例
下列範例顯示 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 父表單內的圖示來並排。