Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
773 lines (707 sloc) 53.4 KB
<Type Name="Menu" FullName="System.Windows.Forms.Menu">
<TypeSignature Language="C#" Value="public abstract class Menu : System.ComponentModel.Component" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi abstract beforefieldinit Menu extends System.ComponentModel.Component" />
<TypeSignature Language="DocId" Value="T:System.Windows.Forms.Menu" />
<TypeSignature Language="VB.NET" Value="Public MustInherit Class Menu&#xA;Inherits Component" />
<TypeSignature Language="C++ CLI" Value="public ref class Menu abstract : System::ComponentModel::Component" />
<TypeSignature Language="F#" Value="type Menu = class&#xA; inherit Component" />
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.ComponentModel.Component</BaseTypeName>
</Base>
<Interfaces />
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.ListBindable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.ToolboxItemFilter("System.Windows.Forms")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-1.1">
<AttributeName>System.ComponentModel.Designer("Microsoft.VisualStudio.Windows.Forms.MenuDesigner, Microsoft.VisualStudio, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Represents the base functionality for all menus. Although <see cref="T:System.Windows.Forms.ToolStripDropDown" /> and <see cref="T:System.Windows.Forms.ToolStripDropDownMenu" /> replace and add functionality to the <see cref="T:System.Windows.Forms.Menu" /> control of previous versions, <see cref="T:System.Windows.Forms.Menu" /> is retained for both backward compatibility and future use if you choose.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This class is the base class for the <xref:System.Windows.Forms.MainMenu>, <xref:System.Windows.Forms.MenuItem>, and <xref:System.Windows.Forms.ContextMenu> classes. You cannot create an instance of this class. The menus for an application consist of <xref:System.Windows.Forms.MenuItem> objects. These can contain other <xref:System.Windows.Forms.MenuItem> objects, representing submenu items. The <xref:System.Windows.Forms.MenuItem> objects can be stored in a <xref:System.Windows.Forms.MainMenu> for display as an entire menu structure for a form or a <xref:System.Windows.Forms.ContextMenu> that is used to display shortcut menus. This class provides functionality that is common for all the menu classes.
Unlike many base classes, the <xref:System.Windows.Forms.Menu> class uses its derived classes to define many of its properties. If you are using your menu in a multiple-document interface (MDI) application, you can use the <xref:System.Windows.Forms.Menu.MdiListItem%2A> property to specify a <xref:System.Windows.Forms.MenuItem> that displays a list of open MDI child forms in your application. The <xref:System.Windows.Forms.Menu.MenuItems%2A> property contains a list of <xref:System.Windows.Forms.MenuItem> objects stored in the menu class. For a <xref:System.Windows.Forms.MainMenu> or <xref:System.Windows.Forms.ContextMenu>, this property contains all the <xref:System.Windows.Forms.MenuItem> objects that are displayed. For a <xref:System.Windows.Forms.MenuItem>, the <xref:System.Windows.Forms.Menu.MenuItems%2A> property represents the submenu items associated with it.
In addition to the properties that are provided for all the derived menu classes, the <xref:System.Windows.Forms.Menu> class also provides methods, such as <xref:System.Windows.Forms.Menu.CloneMenu%2A> and <xref:System.Windows.Forms.Menu.MergeMenu%2A>, that enable you to create new menus from existing menus, and also merge two menu structures together.
The <xref:System.Windows.Forms.Menu> class also defines the nested class <xref:System.Windows.Forms.Menu.MenuItemCollection>. This class defines the collection of <xref:System.Windows.Forms.MenuItem> objects used by the <xref:System.Windows.Forms.Menu.MenuItems%2A> property. You can use the methods of the <xref:System.Windows.Forms.Menu.MenuItemCollection> class to add and remove menu items from a <xref:System.Windows.Forms.MainMenu>, <xref:System.Windows.Forms.ContextMenu>, or <xref:System.Windows.Forms.MenuItem>.
## Examples
The following code example uses the derived class, <xref:System.Windows.Forms.MenuItem>, to create a menu structure for a form. The example code adds a <xref:System.Windows.Forms.MenuItem> to represent the top-level menu item, adds a submenu item to it for selecting a font size, and then adds two submenu items to that menu item that represent large and small font choices in an application. The example requires that there is a <xref:System.Windows.Forms.MainMenu> object named `mainMenu1` and four <xref:System.Windows.Forms.MenuItem> objects named `menuItem1`, `menuItem2`, `menuItem3`, and `menuItem4`.
[!code-cpp[Classic Menu Example#1](~/samples/snippets/cpp/VS_Snippets_Winforms/Classic Menu Example/CPP/source.cpp#1)]
[!code-csharp[Classic Menu Example#1](~/samples/snippets/csharp/VS_Snippets_Winforms/Classic Menu Example/CS/source.cs#1)]
[!code-vb[Classic Menu Example#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/Classic Menu Example/VB/source.vb#1)]
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.MainMenu" />
<altmember cref="T:System.Windows.Forms.ContextMenu" />
<altmember cref="T:System.Windows.Forms.MenuItem" />
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="protected Menu (System.Windows.Forms.MenuItem[] items);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig specialname rtspecialname instance void .ctor(class System.Windows.Forms.MenuItem[] items) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.Menu.#ctor(System.Windows.Forms.MenuItem[])" />
<MemberSignature Language="VB.NET" Value="Protected Sub New (items As MenuItem())" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; Menu(cli::array &lt;System::Windows::Forms::MenuItem ^&gt; ^ items);" />
<MemberSignature Language="F#" Value="new System.Windows.Forms.Menu : System.Windows.Forms.MenuItem[] -&gt; System.Windows.Forms.Menu" Usage="new System.Windows.Forms.Menu items" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="items" Type="System.Windows.Forms.MenuItem[]" />
</Parameters>
<Docs>
<param name="items">An array of type <see cref="T:System.Windows.Forms.MenuItem" /> containing the objects to add to the menu.</param>
<summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.Menu" /> class.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Since <xref:System.Windows.Forms.Menu> is an abstract class, only inherited classes can call the Menu constructor.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="CloneMenu">
<MemberSignature Language="C#" Value="protected internal void CloneMenu (System.Windows.Forms.Menu menuSrc);" />
<MemberSignature Language="ILAsm" Value=".method familyorassemblyhidebysig instance void CloneMenu(class System.Windows.Forms.Menu menuSrc) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.Menu.CloneMenu(System.Windows.Forms.Menu)" />
<MemberSignature Language="VB.NET" Value="Protected Friend Sub CloneMenu (menuSrc As Menu)" />
<MemberSignature Language="C++ CLI" Value="protected public:&#xA; void CloneMenu(System::Windows::Forms::Menu ^ menuSrc);" />
<MemberSignature Language="F#" Value="member this.CloneMenu : System.Windows.Forms.Menu -&gt; unit" Usage="menu.CloneMenu menuSrc" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="menuSrc" Type="System.Windows.Forms.Menu" />
</Parameters>
<Docs>
<param name="menuSrc">The <see cref="T:System.Windows.Forms.Menu" /> to copy.</param>
<summary>Copies the <see cref="T:System.Windows.Forms.Menu" /> that is passed as a parameter to the current <see cref="T:System.Windows.Forms.Menu" />.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method copies the entire list of <xref:System.Windows.Forms.MenuItem> objects (stored in the <xref:System.Windows.Forms.Menu> passed in to `menuSrc`) into the current menu. You can use this method in your derived class to clone <xref:System.Windows.Forms.MenuItem> objects. They can then be reused by other classes that derive from <xref:System.Windows.Forms.Menu>, such as <xref:System.Windows.Forms.MainMenu>, <xref:System.Windows.Forms.ContextMenu>, and <xref:System.Windows.Forms.MenuItem>.
## Examples
This example creates a main menu, `mainMenu1`, with three menu items: `File`, `Edit`, and `View`. It then uses the <xref:System.Windows.Forms.Menu.CloneMenu%2A> method to copy `mainMenu1` into `mainMenu2`. The cloned menu is then assigned to the form and displayed. This program requires that you have already created a <xref:System.Windows.Forms.Form> named `Form1`.
[!code-cpp[CloneMenu#1](~/samples/snippets/cpp/VS_Snippets_Winforms/CloneMenu/CPP/form1.cpp#1)]
[!code-csharp[CloneMenu#1](~/samples/snippets/csharp/VS_Snippets_Winforms/CloneMenu/CS/form1.cs#1)]
[!code-vb[CloneMenu#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/CloneMenu/VB/form1.vb#1)]
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.MenuItem" />
<altmember cref="T:System.Windows.Forms.MainMenu" />
</Docs>
</Member>
<Member MemberName="CreateMenuHandle">
<MemberSignature Language="C#" Value="protected virtual IntPtr CreateMenuHandle ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance native int CreateMenuHandle() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.Menu.CreateMenuHandle" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Function CreateMenuHandle () As IntPtr" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual IntPtr CreateMenuHandle();" />
<MemberSignature Language="F#" Value="abstract member CreateMenuHandle : unit -&gt; nativeint&#xA;override this.CreateMenuHandle : unit -&gt; nativeint" Usage="menu.CreateMenuHandle " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.IntPtr</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Creates a new handle to the <see cref="T:System.Windows.Forms.Menu" />.</summary>
<returns>A handle to the menu if the method succeeds; otherwise, <see langword="null" />.</returns>
<remarks>To be added.</remarks>
<permission cref="T:System.Security.Permissions.SecurityPermission">for operating with unmanaged code. Associated enumeration: <see cref="F:System.Security.Permissions.SecurityPermissionFlag.UnmanagedCode" /></permission>
</Docs>
</Member>
<Member MemberName="Dispose">
<MemberSignature Language="C#" Value="protected override void Dispose (bool disposing);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void Dispose(bool disposing) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.Menu.Dispose(System.Boolean)" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Sub Dispose (disposing As Boolean)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override void Dispose(bool disposing);" />
<MemberSignature Language="F#" Value="override this.Dispose : bool -&gt; unit" Usage="menu.Dispose disposing" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="disposing" Type="System.Boolean" />
</Parameters>
<Docs>
<param name="disposing">
<see langword="true" /> to release both managed and unmanaged resources; <see langword="false" /> to release only unmanaged resources.</param>
<summary>Disposes of the resources, other than memory, used by the <see cref="T:System.Windows.Forms.Menu" />.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Call <xref:System.Windows.Forms.Menu.Dispose%2A> when you are finished using the <xref:System.Windows.Forms.Menu>. The <xref:System.Windows.Forms.Menu.Dispose%2A> method leaves the <xref:System.Windows.Forms.Menu> in an unusable state. After calling <xref:System.Windows.Forms.Menu.Dispose%2A>, you must release all references to the <xref:System.Windows.Forms.Menu> so the memory it was occupying can be reclaimed by garbage collection.
> [!NOTE]
> Always call <xref:System.Windows.Forms.Menu.Dispose%2A> before you release your last reference to the <xref:System.Windows.Forms.Menu>. Otherwise, the resources the <xref:System.Windows.Forms.Menu> is using will not be freed until garbage collection calls the <xref:System.Windows.Forms.Menu> object's destructor.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="FindHandle">
<MemberSignature Language="C#" Value="public const int FindHandle = 0;" />
<MemberSignature Language="ILAsm" Value=".field public static literal int32 FindHandle = (0)" />
<MemberSignature Language="DocId" Value="F:System.Windows.Forms.Menu.FindHandle" />
<MemberSignature Language="VB.NET" Value="Public Const FindHandle As Integer = 0" />
<MemberSignature Language="C++ CLI" Value="public: int FindHandle = 0;" />
<MemberSignature Language="F#" Value="val mutable FindHandle : int" Usage="System.Windows.Forms.Menu.FindHandle" />
<MemberType>Field</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<MemberValue>0</MemberValue>
<Docs>
<summary>Specifies that the <see cref="M:System.Windows.Forms.Menu.FindMenuItem(System.Int32,System.IntPtr)" /> method should search for a handle.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="FindMenuItem">
<MemberSignature Language="C#" Value="public System.Windows.Forms.MenuItem FindMenuItem (int type, IntPtr value);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Windows.Forms.MenuItem FindMenuItem(int32 type, native int value) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.Menu.FindMenuItem(System.Int32,System.IntPtr)" />
<MemberSignature Language="VB.NET" Value="Public Function FindMenuItem (type As Integer, value As IntPtr) As MenuItem" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; System::Windows::Forms::MenuItem ^ FindMenuItem(int type, IntPtr value);" />
<MemberSignature Language="F#" Value="member this.FindMenuItem : int * nativeint -&gt; System.Windows.Forms.MenuItem" Usage="menu.FindMenuItem (type, value)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.MenuItem</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="type" Type="System.Int32" />
<Parameter Name="value" Type="System.IntPtr" />
</Parameters>
<Docs>
<param name="type">The type of item to use to find the <see cref="T:System.Windows.Forms.MenuItem" />.</param>
<param name="value">The item to use to find the <see cref="T:System.Windows.Forms.MenuItem" />.</param>
<summary>Gets the <see cref="T:System.Windows.Forms.MenuItem" /> that contains the value specified.</summary>
<returns>The <see cref="T:System.Windows.Forms.MenuItem" /> that matches value; otherwise, <see langword="null" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
To search for a <xref:System.Windows.Forms.MenuItem> using a handle, pass in the <xref:System.Windows.Forms.Menu.FindHandle> field as the type, and the handle of the <xref:System.Windows.Forms.MenuItem> you want to find as the value.
To search for a <xref:System.Windows.Forms.MenuItem> using a shortcut, pass in the <xref:System.Windows.Forms.Menu.FindShortcut> field as the type, and the Shortcut value for the <xref:System.Windows.Forms.MenuItem> you want to find as the value.
]]></format>
</remarks>
<permission cref="T:System.Security.Permissions.UIPermission">for controls to call this method. Associated enumeration: <see cref="F:System.Security.Permissions.UIPermissionWindow.AllWindows" /></permission>
</Docs>
</Member>
<Member MemberName="FindMergePosition">
<MemberSignature Language="C#" Value="protected int FindMergePosition (int mergeOrder);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig instance int32 FindMergePosition(int32 mergeOrder) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.Menu.FindMergePosition(System.Int32)" />
<MemberSignature Language="VB.NET" Value="Protected Function FindMergePosition (mergeOrder As Integer) As Integer" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; int FindMergePosition(int mergeOrder);" />
<MemberSignature Language="F#" Value="member this.FindMergePosition : int -&gt; int" Usage="menu.FindMergePosition mergeOrder" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="mergeOrder" Type="System.Int32" />
</Parameters>
<Docs>
<param name="mergeOrder">The merge order position for the menu item to be merged.</param>
<summary>Returns the position at which a menu item should be inserted into the menu.</summary>
<returns>The position at which a menu item should be inserted into the menu.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The merge order of a menu item specifies the relative position that this menu item will assume if the menu structure that the <xref:System.Windows.Forms.MenuItem> is contained in is merged with another.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="FindShortcut">
<MemberSignature Language="C#" Value="public const int FindShortcut = 1;" />
<MemberSignature Language="ILAsm" Value=".field public static literal int32 FindShortcut = (1)" />
<MemberSignature Language="DocId" Value="F:System.Windows.Forms.Menu.FindShortcut" />
<MemberSignature Language="VB.NET" Value="Public Const FindShortcut As Integer = 1" />
<MemberSignature Language="C++ CLI" Value="public: int FindShortcut = 1;" />
<MemberSignature Language="F#" Value="val mutable FindShortcut : int" Usage="System.Windows.Forms.Menu.FindShortcut" />
<MemberType>Field</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<MemberValue>1</MemberValue>
<Docs>
<summary>Specifies that the <see cref="M:System.Windows.Forms.Menu.FindMenuItem(System.Int32,System.IntPtr)" /> method should search for a shortcut.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="GetContextMenu">
<MemberSignature Language="C#" Value="public System.Windows.Forms.ContextMenu GetContextMenu ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Windows.Forms.ContextMenu GetContextMenu() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.Menu.GetContextMenu" />
<MemberSignature Language="VB.NET" Value="Public Function GetContextMenu () As ContextMenu" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; System::Windows::Forms::ContextMenu ^ GetContextMenu();" />
<MemberSignature Language="F#" Value="member this.GetContextMenu : unit -&gt; System.Windows.Forms.ContextMenu" Usage="menu.GetContextMenu " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.ContextMenu</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Gets the <see cref="T:System.Windows.Forms.ContextMenu" /> that contains this menu.</summary>
<returns>The <see cref="T:System.Windows.Forms.ContextMenu" /> that contains this menu. The default is <see langword="null" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method allows you to obtain a reference to the <xref:System.Windows.Forms.ContextMenu> that this menu is contained in. This property returns `null` if the menu is not contained in a <xref:System.Windows.Forms.ContextMenu>. This can occur if the menu is contained in a <xref:System.Windows.Forms.MenuItem> or <xref:System.Windows.Forms.MainMenu>, or if the menu is not contained in any menu. You can use this property to determine whether a menu is currently being used, and also to determine where.
## Examples
In this example, you use the <xref:System.Windows.Forms.Menu.GetContextMenu%2A> method to obtain a reference to the shortcut menu that contains `menuItem1` or `menuItem2`, and display the shortcut menu information in a message box. You programmatically create a shortcut menu with two items, `New` and `Open`. You then add functionality to these items by creating the appropriate event handlers. When you run the example, you get a message box that tells you to right-click the form in order to display the shortcut menu. Then, when you click a menu item, you get another message that tells which item has been clicked and displays the information on the containing shortcut menu. This example requires that you have already created a <xref:System.Windows.Forms.Form> named `Form1`.
[!code-cpp[GetContextMenu2#1](~/samples/snippets/cpp/VS_Snippets_Winforms/GetContextMenu2/CPP/form1.cpp#1)]
[!code-csharp[GetContextMenu2#1](~/samples/snippets/csharp/VS_Snippets_Winforms/GetContextMenu2/CS/form1.cs#1)]
[!code-vb[GetContextMenu2#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/GetContextMenu2/VB/form1.vb#1)]
]]></format>
</remarks>
<altmember cref="M:System.Windows.Forms.Menu.GetMainMenu" />
</Docs>
</Member>
<Member MemberName="GetMainMenu">
<MemberSignature Language="C#" Value="public System.Windows.Forms.MainMenu GetMainMenu ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Windows.Forms.MainMenu GetMainMenu() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.Menu.GetMainMenu" />
<MemberSignature Language="VB.NET" Value="Public Function GetMainMenu () As MainMenu" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; System::Windows::Forms::MainMenu ^ GetMainMenu();" />
<MemberSignature Language="F#" Value="member this.GetMainMenu : unit -&gt; System.Windows.Forms.MainMenu" Usage="menu.GetMainMenu " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.MainMenu</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Gets the <see cref="T:System.Windows.Forms.MainMenu" /> that contains this menu.</summary>
<returns>The <see cref="T:System.Windows.Forms.MainMenu" /> that contains this menu.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method allows you to obtain a reference to the <xref:System.Windows.Forms.MainMenu> this menu is currently located in. This property returns `null` if the menu is not contained in a <xref:System.Windows.Forms.MainMenu>. This can occur if the menu is contained in a <xref:System.Windows.Forms.MenuItem> or <xref:System.Windows.Forms.ContextMenu>, or if the menu is not contained in any menu. You can use this property to determine whether a menu is currently being used, and also to determine where.
## Examples
This example declares a <xref:System.Windows.Forms.MainMenu>, `mainMenu1`, and four menu items, `menuItem1`, `menuItem2`, `menuItem3`, and `menuItem4`. Only the first three menu items are added to `mainMenu1` for display. The program then checks to see if `menuItem3` is being used, which is `true`, and determines the form in which it is used. A label text is used to display the name of the form that hosts the <xref:System.Windows.Forms.MainMenu>. If you change the menu item being tested to `menuItem4`, the condition evaluates to `false` because `menuItem4` has never been used. This example requires that you have created a <xref:System.Windows.Forms.Form> named `MyForm` that includes a <xref:System.Windows.Forms.Label> named `label1`.
[!code-cpp[GetMainMenu#1](~/samples/snippets/cpp/VS_Snippets_Winforms/GetMainMenu/CPP/form1.cpp#1)]
[!code-csharp[GetMainMenu#1](~/samples/snippets/csharp/VS_Snippets_Winforms/GetMainMenu/CS/form1.cs#1)]
[!code-vb[GetMainMenu#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/GetMainMenu/VB/form1.vb#1)]
]]></format>
</remarks>
<altmember cref="M:System.Windows.Forms.Menu.GetContextMenu" />
</Docs>
</Member>
<Member MemberName="Handle">
<MemberSignature Language="C#" Value="public IntPtr Handle { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance native int Handle" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.Menu.Handle" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Handle As IntPtr" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property IntPtr Handle { IntPtr get(); };" />
<MemberSignature Language="F#" Value="member this.Handle : nativeint" Usage="System.Windows.Forms.Menu.Handle" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.IntPtr</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a value representing the window handle for the menu.</summary>
<value>The HMENU value of the menu.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
You can use this property to obtain the handle to the menu to perform special operations to the menu outside of the functionality provided by this class or its derived classes.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="IsParent">
<MemberSignature Language="C#" Value="public virtual bool IsParent { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool IsParent" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.Menu.IsParent" />
<MemberSignature Language="VB.NET" Value="Public Overridable ReadOnly Property IsParent As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property bool IsParent { bool get(); };" />
<MemberSignature Language="F#" Value="member this.IsParent : bool" Usage="System.Windows.Forms.Menu.IsParent" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a value indicating whether this menu contains any menu items. This property is read-only.</summary>
<value>
<see langword="true" /> if this menu contains <see cref="T:System.Windows.Forms.MenuItem" /> objects; otherwise, <see langword="false" />. The default is <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
You can use this method to determine whether any <xref:System.Windows.Forms.MenuItem> objects are assigned to this menu. This is equivalent to checking for `null` in the <xref:System.Windows.Forms.Menu.MenuItems%2A> property.
## Examples
The following code example creates a <xref:System.Windows.Forms.MainMenu> with two <xref:System.Windows.Forms.MenuItem> objects. It then uses the <xref:System.Windows.Forms.Menu.IsParent%2A> property to determine whether `mainMenu1` contains menu items. If the condition evaluates `true`, it sets the <xref:System.Windows.Forms.MainMenu.RightToLeft%2A> property to `true` and binds the main menu to the <xref:System.Windows.Forms.Form>. This example requires that you have a <xref:System.Windows.Forms.Form> created that is named `Form1`.
[!code-cpp[IsParent#1](~/samples/snippets/cpp/VS_Snippets_Winforms/IsParent/CPP/form1.cpp#1)]
[!code-csharp[IsParent#1](~/samples/snippets/csharp/VS_Snippets_Winforms/IsParent/CS/form1.cs#1)]
[!code-vb[IsParent#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/IsParent/VB/form1.vb#1)]
]]></format>
</remarks>
<permission cref="T:System.Security.Permissions.SecurityPermission">for operating with unmanaged code. Associated enumeration: <see cref="F:System.Security.Permissions.SecurityPermissionFlag.UnmanagedCode" /></permission>
<altmember cref="P:System.Windows.Forms.Menu.MenuItems" />
</Docs>
</Member>
<Member MemberName="MdiListItem">
<MemberSignature Language="C#" Value="public System.Windows.Forms.MenuItem MdiListItem { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Windows.Forms.MenuItem MdiListItem" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.Menu.MdiListItem" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property MdiListItem As MenuItem" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Windows::Forms::MenuItem ^ MdiListItem { System::Windows::Forms::MenuItem ^ get(); };" />
<MemberSignature Language="F#" Value="member this.MdiListItem : System.Windows.Forms.MenuItem" Usage="System.Windows.Forms.Menu.MdiListItem" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Windows.Forms.MenuItem</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a value indicating the <see cref="T:System.Windows.Forms.MenuItem" /> that is used to display a list of multiple document interface (MDI) child forms.</summary>
<value>A <see cref="T:System.Windows.Forms.MenuItem" /> that represents the menu item displaying a list of MDI child forms that are open in the application.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
You can use this property to determine whether a <xref:System.Windows.Forms.MenuItem> has been specified to display the list of open child windows in an MDI application. To use a specific <xref:System.Windows.Forms.MenuItem> as an MDI list, set the <xref:System.Windows.Forms.MenuItem.MdiList%2A> property in the <xref:System.Windows.Forms.MenuItem> to be used.
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.MenuItem" />
<altmember cref="P:System.Windows.Forms.MenuItem.MdiList" />
</Docs>
</Member>
<Member MemberName="MenuItems">
<MemberSignature Language="C#" Value="public System.Windows.Forms.Menu.MenuItemCollection MenuItems { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Windows.Forms.Menu/MenuItemCollection MenuItems" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.Menu.MenuItems" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property MenuItems As Menu.MenuItemCollection" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Windows::Forms::Menu::MenuItemCollection ^ MenuItems { System::Windows::Forms::Menu::MenuItemCollection ^ get(); };" />
<MemberSignature Language="F#" Value="member this.MenuItems : System.Windows.Forms.Menu.MenuItemCollection" Usage="System.Windows.Forms.Menu.MenuItems" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.MergableProperty(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Content)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Windows.Forms.Menu+MenuItemCollection</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a value indicating the collection of <see cref="T:System.Windows.Forms.MenuItem" /> objects associated with the menu.</summary>
<value>A <see cref="T:System.Windows.Forms.Menu.MenuItemCollection" /> that represents the list of <see cref="T:System.Windows.Forms.MenuItem" /> objects stored in the menu.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
You can use this property to obtain a reference to the list of menu items that are currently stored in the menu. For <xref:System.Windows.Forms.MainMenu> and <xref:System.Windows.Forms.ContextMenu> objects, the <xref:System.Windows.Forms.Menu.MenuItems%2A> property contains the entire menu structure in the control. For the <xref:System.Windows.Forms.MenuItem> class, the <xref:System.Windows.Forms.Menu.MenuItems%2A> property contains the list of submenu items associated with the <xref:System.Windows.Forms.MenuItem>. With the reference to the collection of menu items for the menu (provided by this property), you can add and remove menu items, determine the total number of menu items, and clear the list of menu items from the collection. For more information on maintaining the menu item collection for a menu, see the <xref:System.Windows.Forms.Menu.MenuItemCollection?displayProperty=nameWithType> documentation.
## Examples
The following code example creates an instance of the derived class, <xref:System.Windows.Forms.MainMenu>, and adds a <xref:System.Windows.Forms.MenuItem> object to its collection of <xref:System.Windows.Forms.MenuItem> objects. This example requires that the method defined in this example is located within the class for a form and called by a method in that form class.
[!code-cpp[Classic Menu.MenuItems Example#1](~/samples/snippets/cpp/VS_Snippets_Winforms/Classic Menu.MenuItems Example/CPP/source.cpp#1)]
[!code-csharp[Classic Menu.MenuItems Example#1](~/samples/snippets/csharp/VS_Snippets_Winforms/Classic Menu.MenuItems Example/CS/source.cs#1)]
[!code-vb[Classic Menu.MenuItems Example#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/Classic Menu.MenuItems Example/VB/source.vb#1)]
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.MainMenu" />
<altmember cref="T:System.Windows.Forms.ContextMenu" />
<altmember cref="T:System.Windows.Forms.MenuItem" />
<altmember cref="T:System.Windows.Forms.Menu.MenuItemCollection" />
</Docs>
</Member>
<Member MemberName="MergeMenu">
<MemberSignature Language="C#" Value="public virtual void MergeMenu (System.Windows.Forms.Menu menuSrc);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void MergeMenu(class System.Windows.Forms.Menu menuSrc) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.Menu.MergeMenu(System.Windows.Forms.Menu)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Sub MergeMenu (menuSrc As Menu)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual void MergeMenu(System::Windows::Forms::Menu ^ menuSrc);" />
<MemberSignature Language="F#" Value="abstract member MergeMenu : System.Windows.Forms.Menu -&gt; unit&#xA;override this.MergeMenu : System.Windows.Forms.Menu -&gt; unit" Usage="menu.MergeMenu menuSrc" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="menuSrc" Type="System.Windows.Forms.Menu" />
</Parameters>
<Docs>
<param name="menuSrc">The <see cref="T:System.Windows.Forms.Menu" /> whose menu items are merged with the menu items of the current menu.</param>
<summary>Merges the <see cref="T:System.Windows.Forms.MenuItem" /> objects of one menu with the current menu.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method merges <xref:System.Windows.Forms.MenuItem> objects from one menu with the current menu. <xref:System.Windows.Forms.MenuItem> objects are merged according to the values of the <xref:System.Windows.Forms.MenuItem.MergeType%2A?displayProperty=nameWithType> and <xref:System.Windows.Forms.MenuItem.MergeOrder%2A?displayProperty=nameWithType> properties.
Menu merging is typically done to merge the menus of a Multiple Document Interface (MDI) parent form with those of its active MDI child form. This is performed automatically by the .NET Framework common language runtime. For example, if an MDI parent form contains a set of menus for handling files and your MDI child form also has file-related menu items, the menu sets will automatically merge into a single file menu set when the child form is displayed in the MDI parent form.
You can use the <xref:System.Windows.Forms.Menu.MergeMenu%2A> method if you are merging two menu structures that are not part of an MDI application. This implementation can be called by the <xref:System.Windows.Forms.MainMenu> or <xref:System.Windows.Forms.ContextMenu> classes to merge two or more objects that derive from <xref:System.Windows.Forms.Menu>.
To merge two <xref:System.Windows.Forms.MenuItem> objects use the <xref:System.Windows.Forms.MenuItem.MergeMenu%2A?displayProperty=nameWithType> method.
## Examples
This example creates two menus, `mainMenu1` and `mainMenu2`. The first menu contains one <xref:System.Windows.Forms.MenuItem>, `File`, and the second contains one <xref:System.Windows.Forms.MenuItem>, `Edit`. Using the <xref:System.Windows.Forms.Menu.MergeMenu%2A> method, `mainMenu2` is merged with `mainMenu1`. When displayed, `mainMenu1` will contain the two menu items, `File` and `Edit`. This example requires that you have created a <xref:System.Windows.Forms.Form> named `Form1`.
[!code-cpp[MergeMenu#1](~/samples/snippets/cpp/VS_Snippets_Winforms/MergeMenu/CPP/form1.cpp#1)]
[!code-csharp[MergeMenu#1](~/samples/snippets/csharp/VS_Snippets_Winforms/MergeMenu/CS/form1.cs#1)]
[!code-vb[MergeMenu#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/MergeMenu/VB/form1.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">It was attempted to merge the menu with itself.</exception>
<altmember cref="P:System.Windows.Forms.MenuItem.MergeType" />
<altmember cref="P:System.Windows.Forms.MenuItem.MergeOrder" />
</Docs>
</Member>
<Member MemberName="Name">
<MemberSignature Language="C#" Value="public string Name { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string Name" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.Menu.Name" />
<MemberSignature Language="VB.NET" Value="Public Property Name As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::String ^ Name { System::String ^ get(); void set(System::String ^ value); };" />
<MemberSignature Language="F#" Value="member this.Name : string with get, set" Usage="System.Windows.Forms.Menu.Name" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0">
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0">
<AttributeName>System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the name of the <see cref="T:System.Windows.Forms.Menu" />.</summary>
<value>A string representing the name.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
At design time, this property is set to the programmatic identifier of the control. However, this property has no bearing on the control at run time.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="ProcessCmdKey">
<MemberSignature Language="C#" Value="protected internal virtual bool ProcessCmdKey (ref System.Windows.Forms.Message msg, System.Windows.Forms.Keys keyData);" />
<MemberSignature Language="ILAsm" Value=".method familyorassemblyhidebysig newslot virtual instance bool ProcessCmdKey(valuetype System.Windows.Forms.Message&amp; msg, valuetype System.Windows.Forms.Keys keyData) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.Menu.ProcessCmdKey(System.Windows.Forms.Message@,System.Windows.Forms.Keys)" />
<MemberSignature Language="VB.NET" Value="Protected Friend Overridable Function ProcessCmdKey (ByRef msg As Message, keyData As Keys) As Boolean" />
<MemberSignature Language="C++ CLI" Value="protected public:&#xA; virtual bool ProcessCmdKey(System::Windows::Forms::Message % msg, System::Windows::Forms::Keys keyData);" />
<MemberSignature Language="F#" Value="abstract member ProcessCmdKey : * System.Windows.Forms.Keys -&gt; bool&#xA;override this.ProcessCmdKey : * System.Windows.Forms.Keys -&gt; bool" Usage="menu.ProcessCmdKey (msg, keyData)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="msg" Type="System.Windows.Forms.Message" RefType="ref" />
<Parameter Name="keyData" Type="System.Windows.Forms.Keys" />
</Parameters>
<Docs>
<param name="msg">A <see cref="T:System.Windows.Forms.Message" />, passed by reference that represents the window message to process.</param>
<param name="keyData">One of the <see cref="T:System.Windows.Forms.Keys" /> values that represents the key to process.</param>
<summary>Processes a command key.</summary>
<returns>
<see langword="true" /> if the character was processed by the control; otherwise, <see langword="false" />.</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="Tag">
<MemberSignature Language="C#" Value="public object Tag { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance object Tag" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.Menu.Tag" />
<MemberSignature Language="VB.NET" Value="Public Property Tag As Object" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Object ^ Tag { System::Object ^ get(); void set(System::Object ^ value); };" />
<MemberSignature Language="F#" Value="member this.Tag : obj with get, set" Usage="System.Windows.Forms.Menu.Tag" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0">
<AttributeName>System.ComponentModel.Bindable(true)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0">
<AttributeName>System.ComponentModel.DefaultValue(null)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0">
<AttributeName>System.ComponentModel.Localizable(false)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0">
<AttributeName>System.ComponentModel.TypeConverter(typeof(System.ComponentModel.StringConverter))</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>set: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Object</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets user-defined data associated with the control.</summary>
<value>An object representing the data.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="ToString">
<MemberSignature Language="C#" Value="public override string ToString ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance string ToString() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.Menu.ToString" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function ToString () As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override System::String ^ ToString();" />
<MemberSignature Language="F#" Value="override this.ToString : unit -&gt; string" Usage="menu.ToString " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Returns a <see cref="T:System.String" /> that represents the <see cref="T:System.Windows.Forms.Menu" /> control.</summary>
<returns>A <see cref="T:System.String" /> that represents the current <see cref="T:System.Windows.Forms.Menu" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.Menu.ToString%2A> method returns a <xref:System.String> that includes the type and the number of items in the <xref:System.Windows.Forms.Menu.MenuItems%2A> property of the control.
]]></format>
</remarks>
</Docs>
</Member>
</Members>
</Type>
You can’t perform that action at this time.