ListViewItem.ImageKey 屬性

定義

取得或設定為項目顯示之影像的索引鍵。

public:
 property System::String ^ ImageKey { System::String ^ get(); void set(System::String ^ value); };
[System.ComponentModel.TypeConverter(typeof(System.Windows.Forms.ImageKeyConverter))]
public string ImageKey { get; set; }
[<System.ComponentModel.TypeConverter(typeof(System.Windows.Forms.ImageKeyConverter))>]
member this.ImageKey : string with get, set
Public Property ImageKey As String

屬性值

String

ListViewItem 顯示之影像的索引鍵。

屬性

備註

ImageKeyImageIndex 互斥,這表示如果設定其中一個,另一個會設定為不正確值並忽略。 如果您設定 ImageKey 屬性,屬性 ImageIndex 會自動設定為 -1。 或者,如果您設定 ImageIndex 屬性,會自動 ImageKey 將 設定為空字串 (「」) 。

注意

如果您使用多個影像清單,用於小型和大型圖示檢視,則 ListView 應該將小型和大型版本的影像放在其個別影像清單中的相同索引位置。 在檢視之間切換時,不論指定的索引鍵值為何,都會使用某個清單中的影像索引位置來尋找另一個清單中的影像。

適用於