The currently selected tree item.

Property of

TreeView

Description

The selected property contains an object reference to the currently-selected tree item in the tree view, the one that has focus. If no item is selected, selected contains null.

selected is usually used in TreeView event handlers, which fire for all items in the tree.

selected is read-only. To programmatically select an item, call the item’s select( ) method.