Question Tree View, Using Nodes

a5m0d1

Member
Joined
Mar 14, 2010
Messages
15
Programming Experience
1-3
Does anyone know how to use a name to define a node and not an index?

Say my Treeview looked like this

Domain
----Computers
---------PC01
---------PC02
----Users
----Groups

Somtimes the 3 groups (Computers, Users and Groups) are in a different order and I need to be able to grab the right one no matter what order they are in.

To get the name of PC01 I could
textbox1.text = Treeview1.Nodes(0).Nodes(0).Nodes(0).name

But if they where in a different order it would not return the correct value.

So my question is can I do somthing like this?
This ofc doesnt work but explains what im trying to do
textbox1.text = Treeview1.Nodes(0).Nodes("Computers").Nodes(0).name

Thanks again for your help
 
Back
Top