am not sure if it works because i don't know how your custom node looks like but i think it should be
VB Code:
If (cNode.NodeKey = nextParent) Then
sString = nextElement & " " & nextDesc
TreeView1.SelectedNode = cNode
'rest of the code
or, if your class alows it
VB Code:
If (cNode.NodeKey = nextParent) Then
sString = nextElement & " " & nextDesc
TreeView1.SelectedNode = CType(cNode,Treenode)
''rest of the code
if my ideea of nodeindex is right then index reffers only to the first level of childnodes of the referred node
something like this
( (n) are indexes )
VB Code:
' [+]root(0)
' |
' |------child1(0)
' |
' |---[+]child2(1)
' | |
' | |------child3(0)
' | |
' | '------child4(1)
' |
' '------child5(2)
ie. to reffer child4 you would use mytree.nodes(0).nodes(1).nodes(1)
by the way if one of the code above works for you i'd like to know how your custom treeview class looks like because i never really managed to inherit the treeview and treenode and add custom properties to them.
i found a workthrough on microsoft page wich doesn't work, or it's something i'm missing
it's located here
http://support.microsoft.com/default.aspx?scid=KB;EN-US;311318