Menu.MenuItemCollection(Menu) 建構函式

定義

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

public:
 MenuItemCollection(System::Windows::Forms::Menu ^ owner);
public MenuItemCollection (System.Windows.Forms.Menu owner);
new System.Windows.Forms.Menu.MenuItemCollection : System.Windows.Forms.Menu -> System.Windows.Forms.Menu.MenuItemCollection
Public Sub New (owner As Menu)

參數

owner
Menu

擁有這個集合的 Menu

備註

這個類別需要您將集合與衍生自 Menu 的類別產生關聯,例如 MainMenuContextMenuMenuItem 類別。 由於您必須指定與此集合相關聯的功能表,因此您無法建立多個功能表項目集合,並視需要將它們與功能表產生關聯。 若要切換與功能表相關聯的功能表項目,您必須清除專案的集合,並新增功能表項目以顯示至集合。

適用於

另請參閱