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 父窗体中的图标。