System.Windows.Forms.TreeView.ImageKey Property

Gets or sets the key of the default image for each node in the System.Windows.Forms.TreeView control when it is in an unselected state.

Syntax

[System.ComponentModel.Editor("System.Windows.Forms.Design.ImageIndexEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))]
[System.ComponentModel.TypeConverter(typeof(System.Windows.Forms.ImageKeyConverter))]
[System.ComponentModel.RefreshProperties(System.ComponentModel.RefreshProperties.Repaint)]
[System.Windows.Forms.RelatedImageList("ImageList")]
[System.ComponentModel.DefaultValue("")]
[System.ComponentModel.Localizable(true)]
public string ImageKey { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

The TreeView.ImageKey property is case-insensitive.

If a System.Windows.Forms.TreeNode does not have an image set, the image specified by the TreeView.ImageKey property will be shown when the node is not selected. When the node is selected, the first item in the System.Windows.Forms.ImageList will be shown.

The TreeView.ImageKey and TreeView.ImageIndex properties are mutually exclusive, meaning if one is set, the other is ignored. If you set the TreeView.ImageKey property, the TreeView.ImageIndex property is automatically set to -1. Alternatively, if you set the TreeView.ImageIndex property, the TreeView.ImageKey is automatically set to an empty string ("").

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 2.0.0.0