Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tree view level..

Status
Not open for further replies.

elziko

Programmer
Nov 7, 2000
486
0
0
GB
Can anyone think of any easy way of fining what level any particular node in a TreeView control is a member of?

IE for a certain node is it root, one below root, or maybe two below root etc.

elziko
 
Hello,

What I do with tree view control data is use a "/" or a "\" as a delimiter for the key of the node. I concatinate the keys when forming sub keys: ie.

/one
+ /one/one
/one/one/one
/one/one/two
/one/one/three
+ /one/two
/one/two/one
/one/two/two
/one/two/three

This way I need only count the number of delimiters to see how deep I am.

Hope that helps
scott
 
put this command on treeview clcik event

MsgBox (TreeView1.SelectedItem.FullPath)

from this u can know where u are in the list

with regards
raghu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top