Menu.MenuItemCollection Class
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents a collection of MenuItem objects.
public: ref class Menu::MenuItemCollection : System::Collections::IList
[System.ComponentModel.ListBindable(false)]
public class Menu.MenuItemCollection : System.Collections.IList
[<System.ComponentModel.ListBindable(false)>]
type Menu.MenuItemCollection = class
interface IList
interface ICollection
interface IEnumerable
Public Class Menu.MenuItemCollection
Implements IList
- Inheritance
-
Menu.MenuItemCollection
- Attributes
- Implements
This class represents the collection of MenuItem objects stored in a MainMenu, ContextMenu, or MenuItem. For the MainMenu and ContextMenu classes, this collection represents the entire menu structure for the control. For the MenuItem class, this collection represents the list of submenu items associated with the MenuItem.
The Add and Remove methods enable you to add and remove individual menu items from the collection. You can also use the Clear method to remove all the menu items from the collection.
Menu. |
Initializes a new instance of the Menu.MenuItemCollection class. |
Count |
Gets a value indicating the total number of MenuItem objects in the collection. |
Is |
Gets a value indicating whether the collection is read-only. |
Item[Int32] |
Retrieves the MenuItem at the specified indexed location in the collection. |
Item[String] |
Gets an item with the specified key from the collection. |
Add(Int32, Menu |
Adds a previously created MenuItem at the specified index within the menu item collection. |
Add(Menu |
Adds a previously created MenuItem to the end of the current menu. |
Add(String, Event |
Adds a new MenuItem to the end of the current menu with a specified caption and a specified event handler for the Click event. |
Add(String, Menu |
Adds a new MenuItem to the end of this menu with the specified caption, Click event handler, and items. |
Add(String) |
Adds a new MenuItem, to the end of the current menu, with a specified caption. |
Add |
Adds an array of previously created MenuItem objects to the collection. |
Clear() |
Removes all MenuItem objects from the menu item collection. |
Contains(Menu |
Determines if the specified MenuItem is a member of the collection. |
Contains |
Determines whether the collection contains an item with the specified key. |
Copy |
Copies the entire collection into an existing array at a specified location within the array. |
Equals(Object) |
Determines whether the specified object is equal to the current object. (Inherited from Object) |
Find(String, Boolean) |
Finds the items with the specified key, optionally searching the submenu items. |
Get |
Returns an enumerator that can be used to iterate through the menu item collection. |
Get |
Serves as the default hash function. (Inherited from Object) |
Get |
Gets the Type of the current instance. (Inherited from Object) |
Index |
Retrieves the index of a specific item in the collection. |
Index |
Finds the index of the first occurrence of a menu item with the specified key. |
Memberwise |
Creates a shallow copy of the current Object. (Inherited from Object) |
Remove(Menu |
Removes the specified MenuItem from the menu item collection. |
Remove |
Removes a MenuItem from the menu item collection at a specified index. |
Remove |
Removes the menu item with the specified key from the collection. |
To |
Returns a string that represents the current object. (Inherited from Object) |
ICollection. |
For a description of this member, see IsSynchronized. |
ICollection. |
For a description of this member, see SyncRoot. |
IList. |
For a description of this member, see Add(Object). |
IList. |
For a description of this member, see Contains(Object). |
IList. |
For a description of this member, see IndexOf(Object). |
IList. |
For a description of this member, see Insert(Int32, Object). |
IList. |
For a description of this member, see IsFixedSize. |
IList. |
For a description of this member, see Item[Int32]. |
IList. |
For a description of this member, see Remove(Object). |
Cast<TResult>(IEnumerable) |
Casts the elements of an IEnumerable to the specified type. |
Of |
Filters the elements of an IEnumerable based on a specified type. |
As |
Enables parallelization of a query. |
As |
Converts an IEnumerable to an IQueryable. |
Product | Versions |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: