Bart,
A treeview has many Nodes, and each Node has many Nodes within it.
TreeView1.Nodes .Add("Level1 Node")
TreeView1.Nodes ("Level1 Node").Nodes.Ad d("Level1 Child")
or more correctly
Dim myNode As Windows.Forms.T reeNode = TreeView1.Nodes .Add("Bob")
Dim myNodeChild As Windows.Forms.T reeNode = myNode.Nodes.Ad d("Bob's
Child")
in the 2nd example, when you add a tree node, it passes a reference of this
new node back, whcih you can store in a variable (myNode in this case).
You can then add nodes to myNode directly because you have a reference to
that node. When you do this, the Add again passes back a reference to the
new node (in this case myNodeChild, which is a 2nd level node in the tree
view).
Hope that helps.
Dan
"Bart Steur" <so*****@xs4all .nlwrote in message
news:ua******** ******@TK2MSFTN GP02.phx.gbl...
Hi
As a VB6 user I'm unfamiliar with the Treeview control of VB2005. I read
it was changed but I have a hard time finding the right help/samples for
my problem.
In VB6 you had 1 collection, and adding a node was quite simple. Just
specify the nodes key and position relative to the key where you want to
add your new node.
In VB2005 you can't do that anymore. I looking for a sample or help how
this can be done now.
I've no problem adding the first level nodes, but more how directly add a
new node to an existing node referenced by the Key of that node.
I'll hope you understand my problem and can give me a help reference or
sample or even a solution
Thanks,
Bart