By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,344 Members | 1,114 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,344 IT Pros & Developers. It's quick & easy.

Referencing treeview child-node

P: n/a
How do I return the level and index of any given node?

Let's say I want to reference the child-node in the third level of a
treeview:

Level-1 -> Level-2 -> Level-3

I'm trying to build the view of folders dynamically, as a node is
doubleclicked, eg:

Level-1: C:\
Level-2: C:\Program Files
Level-3: C:\Program Files\My Program
Thanks in advance for your time and help!
Regards /Morten
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi,

I think this is what you are looking for.
http://msdn.microsoft.com/library/de...lpathtopic.asp

Ken
------------------------------
"Morten Snedker" <morten_spammenot_ATdbconsult.dk> wrote in message
news:fm********************************@4ax.com...
How do I return the level and index of any given node?

Let's say I want to reference the child-node in the third level of a
treeview:

Level-1 -> Level-2 -> Level-3

I'm trying to build the view of folders dynamically, as a node is
doubleclicked, eg:

Level-1: C:\
Level-2: C:\Program Files
Level-3: C:\Program Files\My Program
Thanks in advance for your time and help!
Regards /Morten
Nov 21 '05 #2

P: n/a
On Mon, 6 Jun 2005 06:25:48 -0400, "Ken Tucker [MVP]"
<vb***@bellsouth.net> wrote:
Actually I'd already seen that example in the online help. My lack of
patience made me glance instead of reading and understand - since the
FullPath property is what I was missing out on. I ended up with

Dim myFolder As String

Dim lf As ListFolders
lf = New ListFolders(Foldername, False)

lf.Execute()
Dim lfEnum As IEnumerator = lf.GetFolders.GetEnumerator()

While lfEnum.MoveNext()
myFolder = lfEnum.Current
myFolder = myFolder.Substring(InStrRev(myFolder, "\"))
Me.TreeView1.SelectedNode.Nodes.Add(myFolder)
End While

lf = Nothing
Me.TreeView1.SelectedNode.Expand()
....calling it with the TreeView.SelectedNode.FullPath.

Thx for re-routing me. ;-)

Regards /Snedker
I think this is what you are looking for.
http://msdn.microsoft.com/library/de...lpathtopic.asp

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.