MenuStrip.MdiWindowListItem Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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 Property MdiWindowListItem As ToolStripMenuItem

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.
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

.NET Framework
Available since 2.0
Return to top
Show: