TreeNode.SelectedImageIndex Property

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

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

[<TypeConverterAttribute(typeof(TreeViewImageIndexConverter))>]
[<RelatedImageListAttribute("TreeView.ImageList")>]
member SelectedImageIndex : int with get, set

Property Value

Type: System.Int32
A zero-based index value that represents the image position in an ImageList.

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

NoteNote

The default value of the SelectedImageIndex property is the same as the SelectedImageIndex property of the TreeView control that the TreeNode is assigned to.

The following code example creates and assigns an ImageList to a TreeView control and fills the TreeView control with TreeNode objects. The tree nodes are assigned images from the ImageList that is displayed when the tree node is in a selected or unselected state. This example requires that you have a Form containing a TreeView, and an ArrayList containing Customer objects that each contain Order objects. It also requires that the Customer and Order objects are defined.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft