System.Windows.Forms.TreeView.SelectedImageIndex Property

Gets or sets the image list index value of the image that is displayed when a tree node is selected.

Syntax

[System.ComponentModel.Localizable(true)]
[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.NoneExcludedImageIndexConverter))]
[System.Windows.Forms.RelatedImageList("ImageList")]
[System.ComponentModel.DefaultValue(-1)]
public int SelectedImageIndex { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

The TreeView.SelectedImageIndex value is the index of an System.Drawing.Image stored in the System.Windows.Forms.ImageList assigned to the TreeView.ImageList property.

Note:

When setting the TreeView.SelectedImageIndex property at run time, the System.Windows.Forms.TreeView handle is recreated (see Control.RecreateHandle) to update the control's appearance. This causes all tree nodes to be collapsed, except for the selected System.Windows.Forms.TreeNode.

Requirements

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