Export (0) Print
Expand All

MenuStrip.MdiWindowListItem Property

Gets or sets the ToolStripMenuItem that is used to display a list of Multiple-document interface (MDI) child forms.

Namespace:  System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public ToolStripMenuItem MdiWindowListItem { get; set; }

Property Value

Type: System.Windows.Forms.ToolStripMenuItem
A ToolStripMenuItem that represents the menu item displaying a list of MDI child forms that are open in the application.

Use the MdiWindowListItem property to designate or discover which ToolStripMenuItem displays MDI children.

Use the MenuActivate and MenuDeactivate events on child menus to reflect changes to the value of MdiWindowListItem.

The following code example demonstrates the MdiWindowListItem property. This example is part of a larger example provided for the ToolStripPanel class.

// 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;

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft