Live Chat Icon For mobile
Live Chat Icon

How do I programmatically select a node in a TreeView control?

Platform: WinForms| Category: TreeView

You need to set the HideSelection property of the TreeView to false and call:

[C#]
	//Select the first node
this.treeView1.SelectedNode = this.treeView1.Nodes[0];

[VB.NET]

’Select the first node
Me.treeView1.SelectedNode = Me.treeView1.Nodes(0)

Share with

Share on twitter
Share on facebook
Share on linkedin

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.