Link to home
Start Free TrialLog in
Avatar of mailsuhail
mailsuhail

asked on

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
Avatar of mailsuhail
mailsuhail

ASKER

Edited text of question
ASKER CERTIFIED SOLUTION
Avatar of Inteqam
Inteqam

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial

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

you can use my answer for multi selection , i think

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?
i think when clicking it , it will be selected automatically.
but make sure that the hide selection property of the tree view is false.