Hi,
I'm trying to map a tree-node structure and have been racking my brains for the last couple of hours and need some help.
I want to output the structure of a tree view including it's sub-nodes to a string, delimited by a colon.
I have got the code working if the first child nodes do not have any sub-nodes (i.e: root/subnode)
But if any of the subnodes have children, I get stuck!
Please help!
Here's what I have so far.....
VB Code:
Private Sub mapNodes(ByVal myNode As TreeNode) Dim subNode As TreeNode 'Are we at a root node? If myNode.Tag = "root" Then nodeMap = "root:" End If 'Iterate through each sub-node. For Each subNode In myNode.Nodes nodeMap += subNode.Text & ":" 'If this node has children, recurse through them... If subNode.GetNodeCount(False) > 0 Then 'Stuck here!! End If Next End Sub




Reply With Quote