Treeview control

R

Rich

Hi,

I have a treeview in a Windows form. I want to be able to set a node as
default when the form opens programmatically. Can anyone tell me how this
can be done in vb.net (I think you use SelectedNode but I can't get this to
work)??

Best Regards
Rich
 
R

Robin Tucker

Yes, you set SelectedNode to the node you want selected. However, you will
need to "find" this node by traversing the tree (or, like me, by looking it
up in a hashtable relation of key to treenode).
 
H

Herfried K. Wagner [MVP]

* "Rich said:
I have a treeview in a Windows form. I want to be able to set a node as
default when the form opens programmatically. Can anyone tell me how this
can be done in vb.net (I think you use SelectedNode but I can't get this to
work)??

\\\
Me.TreeView1.SelectedNode = Me.TreeView1.Nodes(10)
///
 

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