Hi everyone,
I've gotten myself is bit of a mess where I'm loading a treeview. Basically I initialize the treeview control with a single root node we'll call it root. I do this by using the following syntax:
Now that I've gotten my root node set, I proceed to pass this node to another sub where some children are loaded to the node. The node is passed ByRef (as I think it should be since I'm changing the node a bit by adding children). I then call up the information for the children and proceed to add them to the root node that has been passed using much the same type of syntax as above. This is fine and this works.
The problem is that when the form is finally displayed I'm getting the root node added twice in the treeview control. Both have the children loaded. However, if I do a TreeView.Nodes. Count check it says there is only one node and not two.
It kind of looks like this:
Is this a bug in the TreeView control? I've double checked my code and I'm sure I'm only adding the root node once. Why is it being displayed twice with the exact same information?
I've gotten myself is bit of a mess where I'm loading a treeview. Basically I initialize the treeview control with a single root node we'll call it root. I do this by using the following syntax:
Code:
Dim tNode as TreeNode = New TreeNode("root") tNode.name = "root" TreeView1.Nodes.Add(tNode)
The problem is that when the form is finally displayed I'm getting the root node added twice in the treeview control. Both have the children loaded. However, if I do a TreeView.Nodes. Count check it says there is only one node and not two.
It kind of looks like this:
Code:
root | |-Child 1 |-Child 2 |-Child 3 root | |-Child 1 |-Child 2 |-Child 3
Comment