System.Windows.Forms
1.0.5000.0
2.0.0.0
System.ComponentModel.Component
System.ComponentModel.ListBindable(false)
System.ComponentModel.ToolboxItemFilter("System.Windows.Forms", System.ComponentModel.ToolboxItemFilterType.Allow)
This class is the base class for the , , and classes. You cannot create an instance of this class. The menus for an application consist of objects. These can contain other objects, representing submenu items. The objects can be stored in a for display as an entire menu structure for a form or a that is used to display shortcut menus. This class provides functionality that is common for all the menu classes.
Unlike many base classes, the 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 property to specify a that displays a list of open MDI child forms in your application. The property contains a list of objects stored in the menu class. For a or , this property contains all the objects that are displayed. For a , the property represents the submenu items associated with it.
In addition to the properties that are provided for all the derived menu classes, the class also provides methods, such as and , that enable you to create new menus from existing menus, and also merge two menu structures together.
The class also defines the nested class . This class defines the collection of objects used by the property. You can use the methods of the class to add and remove menu items from a , , or .
Represents the base functionality for all menus. Although and replace and add functionality to the control of previous versions, is retained for both backward compatibility and future use if you choose.
Constructor
Since is an abstract class, only inherited classes can call the Menu constructor.
Initializes a new instance of the class.
An array of type containing the objects to add to the menu.
1.0.5000.0
2.0.0.0
Method
System.Void
This method copies the entire list of objects (stored in the passed in to ) into the current menu. You can use this method in your derived class to clone objects. They can then be reused by other classes that derive from , such as , , and .
Copies the that is passed as a parameter to the current .
The to copy.
1.0.5000.0
2.0.0.0
Method
System.IntPtr
To be added.
Creates a new handle to the .
A handle to the menu if the method succeeds; otherwise, null.
1.0.5000.0
2.0.0.0
Method
System.Void
To be added.
Call when you are finished using the . The method leaves the in an unusable state. After calling , you must release all references to the so the memory it was occupying can be reclaimed by garbage collection.
Always call before you release your last reference to the . Otherwise, the resources the is using will not be freed until garbage collection calls the object's destructor.
Disposes of the resources, other than memory, used by the .
1.0.5000.0
2.0.0.0
Field
System.Int32
0
To be added.
Specifies that the method should search for a handle.
1.0.5000.0
2.0.0.0
Method
System.Windows.Forms.MenuItem
To search for a using a handle, pass in the field as the type, and the handle of the you want to find as the value.
To search for a using a shortcut, pass in the field as the type, and the Shortcut value for the you want to find as the value.
Gets the that contains the value specified.
The that matches value; otherwise, null.
The type of item to use to find the .
The item to use to find the .
1.0.5000.0
2.0.0.0
Method
System.Int32
The merge order of a menu item specifies the relative position that this menu item will assume if the menu structure that the is contained in is merged with another.
Returns the position at which a menu item should be inserted into the menu.
The position at which a menu item should be inserted into the menu.
The merge order position for the menu item to be merged.
1.0.5000.0
2.0.0.0
Field
System.Int32
1
To be added.
Specifies that the method should search for a shortcut.
1.0.5000.0
2.0.0.0
Method
System.Windows.Forms.ContextMenu
This method allows you to obtain a reference to the that this menu is contained in. This property returns null if the menu is not contained in a . This can occur if the menu is contained in a or , 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.
Gets the that contains this menu.
The that contains this menu. The default is null.
1.0.5000.0
2.0.0.0
Method
System.Windows.Forms.MainMenu
This method allows you to obtain a reference to the this menu is currently located in. This property returns null if the menu is not contained in a . This can occur if the menu is contained in a or , 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.
Gets the that contains this menu.
The that contains this menu.
1.0.5000.0
2.0.0.0
Property
System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)
System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)
System.ComponentModel.Browsable(false)
System.IntPtr
To be added.
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.
Gets a value representing the window handle for the menu.
1.0.5000.0
2.0.0.0
Property
System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)
System.ComponentModel.Browsable(false)
System.Boolean
To be added.
You can use this method to determine whether any objects are assigned to this menu. This is equivalent to checking for null in the property.
Gets a value indicating whether this menu contains any menu items. This property is read-only.
1.0.5000.0
2.0.0.0
Property
System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)
System.ComponentModel.Browsable(false)
System.Windows.Forms.MenuItem
To be added.
You can use this property to determine whether a has been specified to display the list of open child windows in an MDI application. To use a specific as an MDI list, set the property in the to be used.
Gets a value indicating the that is used to display a list of multiple document interface (MDI) child forms.
1.0.5000.0
2.0.0.0
Property
System.ComponentModel.MergableProperty(false)
System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Content)
System.ComponentModel.Browsable(false)
System.Windows.Forms.Menu+MenuItemCollection
To be added.
You can use this property to obtain a reference to the list of menu items that are currently stored in the menu. For and objects, the property contains the entire menu structure in the control. For the class, the property contains the list of submenu items associated with the . 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 documentation.
Gets a value indicating the collection of objects associated with the menu.
1.0.5000.0
2.0.0.0
Method
System.Void
This method merges objects from one menu with the current menu. objects are merged according to the values of the and 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 method if you are merging two menu structures that are not part of an MDI application. This implementation can be called by the or classes to merge two or more objects that derive from .
To merge two objects use the method.
Merges the objects of one menu with the current menu.
The whose menu items are merged with the menu items of the current menu.
1.0.5000.0
2.0.0.0
Property
2.0.0.0
System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)
System.ComponentModel.Browsable(false)
System.String
To be added.
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.
Gets or sets the name of the .
Method
1.0.5000.0
2.0.0.0
System.Boolean
To be added.
To be added.
To be added.
To be added.
To be added.
Property
System.ComponentModel.DefaultValue(null)
System.ComponentModel.TypeConverter(typeof(System.ComponentModel.StringConverter))
System.ComponentModel.Bindable(true)
System.ComponentModel.Localizable(false)
System.Object
To be added.
To be added.
Gets or sets user-defined data associated with the control.
2.0.0.0
Method
System.String
The method returns a that includes the type and the number of items in the property of the control.
Returns a that represents the control.
A that represents the current .
1.0.5000.0
2.0.0.0