TreeView.SelectedNode

J

John Smith

Language: VB.NET

How do I highlight a selected node programmatically?

After I click a Menu Item, I want to default my selected node to a specific
node. When this event occurs the selected node is correct but the selected
node is not highlighted. How do I highlight it?

Thanx in advance,
John Smith

'--------------------------------
'Sample Code
'--------------------------------

Private Sub MenuItem1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MenuItem1.Click

TreeView1.SelectedNode = TreeView1.Nodes(0).Nodes(5)

End Sub
 
D

Daniel Moth

Try:
TreeView1.SelectedNode = Nothing
TreeView1.SelectedNode = SomeNode

Cheers
Daniel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top