System.Windows.Forms.TreeNode.StateImageIndex Property

Gets or sets the index 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.NoneExcludedImageIndexConverter))]
[System.Windows.Forms.RelatedImageList("TreeView.StateImageList")]
[System.ComponentModel.DefaultValue(-1)]
[System.ComponentModel.Localizable(true)]
public int StateImageIndex { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

The image index 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.StateImageIndex 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.StateImageIndex.

The TreeNode.StateImageIndex returns -1 when not set. 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 ("").

Requirements

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