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

定義

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

オーバーロード

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

パラメーター

index
Int32

コレクション内の MenuItem のインデックス位置。

プロパティ値

MenuItem

指定した位置にある MenuItem

例外

value パラメーターが null です。

or index パラメーターが 0 未満。

or index パラメーターの値がコレクション内のメニュー項目数を超える値であり、メニュー項目のコレクションが null ではありません。

注釈

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

こちらもご覧ください

適用対象

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

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

プロパティ値

MenuItem

指定したキーを持つ MenuItem

注釈

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

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

適用対象