MenuItemCollection MenuItemCollection MenuItemCollection MenuItemCollection Constructors

Definition

Overloads

MenuItemCollection() MenuItemCollection() MenuItemCollection()

Initializes a new instance of the MenuItemCollection class using the default values.

MenuItemCollection(MenuItem) MenuItemCollection(MenuItem) MenuItemCollection(MenuItem) MenuItemCollection(MenuItem)

Initializes a new instance of the MenuItemCollection class using the specified parent menu item (or owner).

MenuItemCollection() MenuItemCollection() MenuItemCollection()

Initializes a new instance of the MenuItemCollection class using the default values.

public:
 MenuItemCollection();
public MenuItemCollection ();
Public Sub New ()

Remarks

Use this constructor to initialize a new instance of the MenuItemCollection class using the default values. This constructor is commonly used when creating a collection of root menu items where a parent menu (or owner) is not required.

Note

When creating a collection of child menu items, you should use the overloaded constructor that takes the owner parameter, instead of this constructor, to specify the parent menu item.

This constructor is used primarily by control developers when extending the Menu control to initialize the Items property.

See also

MenuItemCollection(MenuItem) MenuItemCollection(MenuItem) MenuItemCollection(MenuItem) MenuItemCollection(MenuItem)

Initializes a new instance of the MenuItemCollection class using the specified parent menu item (or owner).

public:
 MenuItemCollection(System::Web::UI::WebControls::MenuItem ^ owner);
public MenuItemCollection (System.Web.UI.WebControls.MenuItem owner);
new System.Web.UI.WebControls.MenuItemCollection : System.Web.UI.WebControls.MenuItem -> System.Web.UI.WebControls.MenuItemCollection
Public Sub New (owner As MenuItem)

Parameters

owner
MenuItem MenuItem MenuItem MenuItem

A MenuItem that represents the parent menu item of the current MenuItemCollection.

Remarks

Use this constructor to initialize a new instance of the MenuItemCollection class using the specified parent menu item (or owner). This constructor is commonly used when creating a collection of child menu items where you need to specify the parent menu item.

Note

When creating a collection of root menu items, consider using the default constructor because root menu items do not have a parent menu item.

This constructor is used primarily by control developers when extending the MenuItem class to initialize the ChildItems property.

See also

Applies to