MenuStrip.MdiWindowListItem プロパティ

定義

マルチ ドキュメント インターフェイス (MDI: Multiple Document Interface) の子フォームのリストを表示するために使用される 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 使用して、MDI 子を表示するを ToolStripMenuItem 指定または検出します。

子メニューの MenuActivate イベントと MenuDeactivate イベントを使用して、 の MdiWindowListItem値に対する変更を反映します。

適用対象