Hope you are all well!
Right then, my app needs to re-populate a tree view at runtime with the nodes that were in it from the last time the application was closed.
I write the structure to the registry like this:-
VB Code:
Private Sub mapNodes(ByVal myNode As TreeNode) Dim subNode As TreeNode Dim i As Integer 'Iterate through each sub-node. For Each subNode In myNode.Nodes 'If this node has children, recurse through them... If subNode.GetNodeCount(False) > 0 Then mapNodes(subNode) Else 'this node has no children so map it's full path. nodeMap += subNode.FullPath & ":" End If Next End Sub
This basically writes the following string to the registry (elsewhere in the code).
User's Home Folder\Word\Docs\Personal:User's Home Folder\Word\Docs\Business:User's Home Folder\Excel:User's Home Folder\Powerpoint:
As you can see, each full node path is seperated by a colon, and each individual node and it's sub-nodes are seperated by a slash.
I know how to retrieve the string back from the registry but am having enormous trouble getting the information back into the correct tree node structure.
Any ideas??




Reply With Quote