Share via


ImageList.ImageCollection.Item[] プロパティ

定義

既存の Image 内の ImageList を取得または設定します。

オーバーロード

Item[String]

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

Item[Int32]

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

Item[String]

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

public:
 property System::Drawing::Image ^ default[System::String ^] { System::Drawing::Image ^ get(System::String ^ key); };
public System.Drawing.Image this[string key] { get; }
public System.Drawing.Image? this[string key] { get; }
member this.Item(string) : System.Drawing.Image
Default Public ReadOnly Property Item(key As String) As Image

パラメーター

key
String

コレクションから取得するイメージの名前。

プロパティ値

Image

指定したキーを持つ Image

注釈

イメージ ImageList.ImageCollectionの名前は、 キーの比較では、大文字と小文字は区別されません。

指定したキーを持つイメージが見つからない場合、プロパティの Item[] 値は null.

適用対象

Item[Int32]

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

public:
 property System::Drawing::Image ^ default[int] { System::Drawing::Image ^ get(int index); void set(int index, System::Drawing::Image ^ value); };
[System.ComponentModel.Browsable(false)]
public System.Drawing.Image this[int index] { get; set; }
[<System.ComponentModel.Browsable(false)>]
member this.Item(int) : System.Drawing.Image with get, set
Default Public Property Item(index As Integer) As Image

パラメーター

index
Int32

取得または設定するイメージのインデックス。

プロパティ値

Image

index で指定されている、リスト内のイメージ。

属性

例外

インデックスが 0 未満であるか、または Count 以上です。

imageBitmap ではありません。

割り当てられたイメージが null です。または Bitmap ではありません。

イメージをリストに追加できません。

注釈

返されるビットマップは元のイメージのコピーであり、メソッドを使用して破棄する Image.Dispose 必要があります。

適用対象