次の方法で共有


Menu.MenuItemCollection.Item[] プロパティ

定義

コレクションから項目を取得します。

オーバーロード

名前 説明
Item[Int32]

コレクション内の指定したインデックス位置にある MenuItem を取得します。

Item[String]

指定したキーを持つ項目をコレクションから取得します。

Item[Int32]

ソース:
Menu.MenuItemCollection.cs
ソース:
Menu.MenuItemCollection.cs

コレクション内の指定したインデックス位置にある 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

パラメーター

index
Int32

コレクション内の MenuItem のインデックス付き場所。

プロパティ値

指定した場所にある MenuItem

例外

value パラメーターはnull

または

index パラメーターが 0 未満です。

または

index パラメーターがコレクション内のメニュー項目の数より大きく、メニュー項目のコレクションがnullされていません。

注釈

MenuItemオブジェクトを特定の場所に割り当てたり、Menu.MenuItemCollectionから取得したりするには、特定のインデックス値を持つコレクション オブジェクトを参照できます。 Menu.MenuItemCollectionのインデックス値は 0 から始まるインデックスです。

こちらもご覧ください

適用対象

Item[String]

ソース:
Menu.MenuItemCollection.cs
ソース:
Menu.MenuItemCollection.cs

指定したキーを持つ項目をコレクションから取得します。

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

コレクションから取得する項目の名前。

プロパティ値

指定したキーを持つ MenuItem

注釈

Name プロパティは、Menu.MenuItemCollection内のMenuItemのキーに対応します。

キーの比較では、大文字と小文字は区別されません。 key パラメーターがnullまたは空の文字列の場合、Item[]nullを返します。

適用対象