MenuItemCollection 建構函式

定義

初始化 MenuItemCollection 類別的新執行個體。

多載

MenuItemCollection()

使用預設值,初始化 MenuItemCollection 類別的新執行個體。

MenuItemCollection(MenuItem)

使用指定的父功能表項目 (或擁有人),初始化 MenuItemCollection 類別的新執行個體。

MenuItemCollection()

使用預設值,初始化 MenuItemCollection 類別的新執行個體。

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

備註

使用此建構函式,使用預設值初始化 類別的新實例 MenuItemCollection 。 建立根功能表項目集合時,通常使用此建構函式,其中不需要父功能表 (或擁有者) 。

注意

建立子功能表項集合時,您應該使用採用 owner 參數而非這個建構函式的多載建構函式來指定父功能表項目。

擴充 控制項以初始化 Items 屬性時 Menu ,此建構函式主要是由控制項開發人員使用。

另請參閱

適用於

MenuItemCollection(MenuItem)

使用指定的父功能表項目 (或擁有人),初始化 MenuItemCollection 類別的新執行個體。

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)

參數

owner
MenuItem

MenuItem,表示目前 MenuItemCollection 的父功能表項目。

備註

使用此建構函式,使用指定的父功能表項目 (或擁有者) ,初始化 類別的新實例 MenuItemCollection 。 建立需要指定父功能表項目的子功能表項集合時,通常會使用此建構函式。

注意

建立根功能表項目集合時,請考慮使用無參數建構函式,因為根功能表項目沒有父功能表項目。

擴充 類別以初始化 ChildItems 屬性時 MenuItem ,此建構函式主要是由控制項開發人員使用。

另請參閱

適用於