MenuStrip.MdiWindowListItem 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取或设置用于显示多文档界面 (MDI) 子窗体列表的 ToolStripMenuItem。
public:
property System::Windows::Forms::ToolStripMenuItem ^ MdiWindowListItem { System::Windows::Forms::ToolStripMenuItem ^ get(); void set(System::Windows::Forms::ToolStripMenuItem ^ value); };
[System.ComponentModel.TypeConverter(typeof(System.Windows.Forms.MdiWindowListItemConverter))]
public System.Windows.Forms.ToolStripMenuItem MdiWindowListItem { get; set; }
[System.ComponentModel.TypeConverter(typeof(System.Windows.Forms.MdiWindowListItemConverter))]
public System.Windows.Forms.ToolStripMenuItem? MdiWindowListItem { get; set; }
[<System.ComponentModel.TypeConverter(typeof(System.Windows.Forms.MdiWindowListItemConverter))>]
member this.MdiWindowListItem : System.Windows.Forms.ToolStripMenuItem with get, set
Public Property MdiWindowListItem As ToolStripMenuItem
属性值
表示菜单项(显示应用程序中打开的 MDI 子窗体列表)的 ToolStripMenuItem。
- 属性
示例
下面的代码示例演示 了 MdiWindowListItem 属性。 此示例是为 类提供的更大示例的 ToolStripPanel 一部分。
// Create a MenuStrip control with a new window.
MenuStrip ms = new MenuStrip();
ToolStripMenuItem windowMenu = new ToolStripMenuItem("Window");
ToolStripMenuItem windowNewMenu = new ToolStripMenuItem("New", null, new EventHandler(windowNewMenu_Click));
windowMenu.DropDownItems.Add(windowNewMenu);
((ToolStripDropDownMenu)(windowMenu.DropDown)).ShowImageMargin = false;
((ToolStripDropDownMenu)(windowMenu.DropDown)).ShowCheckMargin = true;
// Assign the ToolStripMenuItem that displays
// the list of child forms.
ms.MdiWindowListItem = windowMenu;
// Add the window ToolStripMenuItem to the MenuStrip.
ms.Items.Add(windowMenu);
// Dock the MenuStrip to the top of the form.
ms.Dock = DockStyle.Top;
// The Form.MainMenuStrip property determines the merge target.
this.MainMenuStrip = ms;
' Create a MenuStrip control with a new window.
Dim ms As New MenuStrip()
Dim windowMenu As New ToolStripMenuItem("Window")
Dim windowNewMenu As New ToolStripMenuItem("New", Nothing, New EventHandler(AddressOf windowNewMenu_Click))
windowMenu.DropDownItems.Add(windowNewMenu)
CType(windowMenu.DropDown, ToolStripDropDownMenu).ShowImageMargin = False
CType(windowMenu.DropDown, ToolStripDropDownMenu).ShowCheckMargin = True
' Assign the ToolStripMenuItem that displays
' the list of child forms.
ms.MdiWindowListItem = windowMenu
' Add the window ToolStripMenuItem to the MenuStrip.
ms.Items.Add(windowMenu)
' Dock the MenuStrip to the top of the form.
ms.Dock = DockStyle.Top
' The Form.MainMenuStrip property determines the merge target.
Me.MainMenuStrip = ms
注解
MdiWindowListItem使用 属性指定或发现显示 ToolStripMenuItem MDI 子级的 。
使用子菜单上的 MenuActivate 和 MenuDeactivate 事件来反映 对 值 MdiWindowListItem所做的更改。