System.Windows.Forms.TreeNode.StateImageKey Property

Gets or sets the key of the image that is used to indicate the state of the System.Windows.Forms.TreeNode when the parent System.Windows.Forms.TreeView has its TreeView.CheckBoxes property set to false.

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.RefreshProperties(System.ComponentModel.RefreshProperties.Repaint)]
[System.ComponentModel.TypeConverter(typeof(System.Windows.Forms.ImageKeyConverter))]
[System.Windows.Forms.RelatedImageList("TreeView.StateImageList")]
[System.ComponentModel.DefaultValue("")]
[System.ComponentModel.Localizable(true)]
public string StateImageKey { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

The image key that is returned by this property is contained in the TreeView.StateImageList property of the parent System.Windows.Forms.TreeView control.

If the parent System.Windows.Forms.TreeView has check boxes enabled, the TreeNode.StateImageKey is ignored and the node will display the first or second image in the TreeView.StateImageList set on the parent System.Windows.Forms.TreeView to indicate an unchecked or checked state, respectively. Toggling the TreeNode.Checked property does not affect the value of the TreeNode.StateImageKey.

The TreeNode.StateImageKey and TreeNode.StateImageIndex properties are mutually exclusive, meaning if one is set, the other is ignored. If you set the TreeNode.StateImageKey property, the TreeNode.StateImageIndex property is automatically set to -1. Alternatively, if you set TreeNode.StateImageIndex, TreeNode.StateImageKey is automatically set to an empty string (""). You should set the TreeNode.StateImageKey to an image with a corresponding index between 0 and 14. You can set the TreeNode.StateImageKey to an image with an index value greater than 14 (an exception will not be thrown), but the image may not be displayed

Requirements

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