Form.LayoutMdi 方法

在 MDI 父窗体内排列多文档界面 (MDI) 子窗体。

**命名空间:**System.Windows.Forms
**程序集:**System.Windows.Forms(在 system.windows.forms.dll 中)

语法

声明
Public Sub LayoutMdi ( _
    value As MdiLayout _
)
用法
Dim instance As Form
Dim value As MdiLayout

instance.LayoutMdi(value)
public void LayoutMdi (
    MdiLayout value
)
public:
void LayoutMdi (
    MdiLayout value
)
public void LayoutMdi (
    MdiLayout value
)
public function LayoutMdi (
    value : MdiLayout
)

参数

  • value
    MdiLayout 值之一,定义 MDI 子窗体的布局。

备注

可以使用此方法在 MDI 父窗体中排列 MDI 子窗体,以便更易于导航和操作 MDI 子窗体。MDI 子窗体可以在 MDI 父窗体内水平和垂直平铺、层叠或作为图标。

示例

下面的代码示例显示 MDI 应用程序父窗体中 Window 菜单的菜单项的事件处理程序。每个事件处理程序都调用 LayoutMdi 方法,以排列当前在应用程序中打开的所有子窗体。

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
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:
   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 );
   }
public void HorizontallyTileMyWindows(Object sender, System.EventArgs e)
{
    // Tile all child forms horizontally.
    this.LayoutMdi(MdiLayout.TileHorizontal);
} //HorizontallyTileMyWindows

public void VerticallyTileMyWindows(Object sender, System.EventArgs e)
{
    // Tile all child forms vertically.
    this.LayoutMdi(MdiLayout.TileVertical);
} //VerticallyTileMyWindows

public void CascadeMyWindows(Object sender, System.EventArgs e)
{
    // Cascade all MDI child windows.
    this.LayoutMdi(MdiLayout.Cascade);
} //CascadeMyWindows

平台

Windows 98、Windows 2000 SP4、Windows CE、Windows Millennium Edition、Windows Mobile for Pocket PC、Windows Mobile for Smartphone、Windows Server 2003、Windows XP Media Center Edition、Windows XP Professional x64 Edition、Windows XP SP2、Windows XP Starter Edition

.NET Framework 并不是对每个平台的所有版本都提供支持。有关受支持版本的列表,请参见系统要求

版本信息

.NET Framework

受以下版本支持:2.0、1.1、1.0

请参见

参考

Form 类
Form 成员
System.Windows.Forms 命名空间
MdiLayout