TreeNode.ImageKey 屬性

定義

取得或設定影像的索引鍵,這個影像會在節點處於未選取狀態時與這個樹狀節點關聯。

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

屬性值

當節點處於未選取狀態時,與這個樹狀節點關聯之影像的索引鍵。

屬性

備註

這個屬性傳回的影像索引鍵包含在包含 TreeView 控制項的 屬性中 ImageList

ImageKey不區分大小寫。

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

適用於