System.Windows.Forms.TreeView.StateImageList Property

Gets or sets the image list that is used to indicate the state of the System.Windows.Forms.TreeView and its nodes.

Syntax

[System.ComponentModel.DefaultValue(null)]
public ImageList StateImageList { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

To indicate the state of a System.Windows.Forms.TreeNode, set the TreeView.StateImageList property and also set the TreeNode.StateImageKey or TreeNode.StateImageIndex property for each System.Windows.Forms.TreeNode.

The state images displayed in the System.Windows.Forms.TreeView are 16 x 16 pixels by default. Setting the ImageList.ImageSize property of the TreeView.StateImageList will have no effect on how the images are displayed. However, the state images are resized according to the system DPI setting when the app.config file contains the following entry:

Example

<appSettings>
  <add key="EnableWindowsFormsHighDpiAutoResizing" value="true" />
</appSettings>

When the TreeView.CheckBoxes property of a System.Windows.Forms.TreeView is set to true and the TreeView.StateImageList property is set, each System.Windows.Forms.TreeNode that is contained in the System.Windows.Forms.TreeView displays the first and second images from the TreeView.StateImageList to indicate an unchecked or checked state, respectively. You should set the TreeView.StateImageList property before you add nodes to the System.Windows.Forms.TreeView to prevent state images being shown at design time for nodes that do not have a state image set.

Requirements

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