Menu.MenuItemCollection.Item[] 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
從收藏中取得一件物品。
多載
| 名稱 | Description |
|---|---|
| Item[Int32] |
在集合中指定的索引位置檢索 。MenuItem |
| Item[String] |
從集合中取得一個帶有指定金鑰的項目。 |
Item[Int32]
在集合中指定的索引位置檢索 。MenuItem
public:
virtual property System::Windows::Forms::MenuItem ^ default[int] { System::Windows::Forms::MenuItem ^ get(int index); };
public virtual System.Windows.Forms.MenuItem this[int index] { get; }
member this.Item(int) : System.Windows.Forms.MenuItem
Default Public Overridable ReadOnly Property Item(index As Integer) As MenuItem
參數
屬性值
他們 MenuItem 在指定的地點。
例外狀況
備註
若要將物件指派 MenuItem 到特定位置,或從 Menu.MenuItemCollection中擷取物件,您可以使用特定的索引值來參考集合物件。 的 Menu.MenuItemCollection 索引值為零為基礎的索引。
另請參閱
適用於
Item[String]
從集合中取得一個帶有指定金鑰的項目。
public:
virtual property System::Windows::Forms::MenuItem ^ default[System::String ^] { System::Windows::Forms::MenuItem ^ get(System::String ^ key); };
public virtual System.Windows.Forms.MenuItem this[string key] { get; }
member this.Item(string) : System.Windows.Forms.MenuItem
Default Public Overridable ReadOnly Property Item(key As String) As MenuItem
參數
- key
- String
要從收藏中取回的物品名稱。
屬性值
備註
該Name性質對應於 中 a 的MenuItemMenu.MenuItemCollection鍵。
關鍵比較並不區分大小寫。 若 key 參數為 null 或 為空字串,則 Item[] 回傳 null。