node selection

how do we select a particular node in a treeview? Or what is the equivalent for treeview in the following  example of listbox.

private sub form_load()

list1.listindex= 0

end sub
mailsuhailAsked:
Who is Participating?
 
InteqamConnect With a Mentor Commented:
treeview.nodes.item(1).selected=true

0
 
mailsuhailAuthor Commented:
Edited text of question
0
 
MirkwoodCommented:

set treeview1.selecteditem = treeview1.nodes(anode.key)

Where treeview1 is the treeview control and anode is a treeview  node

or like Inteqam said
treeview.nodes.item(1).selected=true

0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
InteqamCommented:
you can use my answer for multi selection , i think

0
 
mailsuhailAuthor Commented:
when i pasted this code (suggested by Inteqam) in the Form_load event  it worked fine but when i tried it in Command_clik event it didn't work. Why?
0
 
InteqamCommented:
i think when clicking it , it will be selected automatically.
but make sure that the hide selection property of the tree view is false.

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.