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

image 不是 Bitmap

要指派的影像是 null 或者不是 Bitmap

無法將影像加入至清單。

備註

傳回的點陣圖是原始影像的複本,應該使用 Image.Dispose 方法處置。

適用於