System.Windows.Forms.TreeView.SelectedNode Property

Gets or sets the tree node that is currently selected in the tree view control.

Syntax

[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.ComponentModel.Browsable(false)]
public TreeNode SelectedNode { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

If no System.Windows.Forms.TreeNode is currently selected, the TreeView.SelectedNode property is null.

When you set this property, the specified node is scrolled into view and any parent nodes are expanded so that the specified node is visible.

When the parent node or any ancestor node of the selected node is collapsed either programmatically or through user action, the collapsed node becomes the selected node.

Requirements

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