Matt_Unsworth
asked on
Simple treeview question
I have built a treeview with several nodes.......however.
I now want to assign separate events to each of the nodes, I have already coded the actual events but how do you declare an individual node as a sub procedure.
eg
Within the treeview one of my nodes  looks like this....
Set nodX = TreeView1.Nodes.Add("r", tvwChild, "c1", "Load")
So, how do I assign a NodeClick event to this individual node
ie
Private Sub....................... .......... .......... .......... .......
Cheers,
Matt.
I now want to assign separate events to each of the nodes, I have already coded the actual events but how do you declare an individual node as a sub procedure.
eg
Within the treeview one of my nodes  looks like this....
Set nodX = TreeView1.Nodes.Add("r", tvwChild, "c1", "Load")
So, how do I assign a NodeClick event to this individual node
ie
Private Sub.......................
Cheers,
Matt.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks,
Matt
Matt
You could probably subclass the treeview , but then its no longer a "Simple Treeview Question"
The NodeClick event passes a reference to the Node that was clicked so use a
Select Case, to handle the different nodes.
Use the Tag property to hold an extra id data, remember in the Common Controls that come with VB6 can have objects in the Tag property.
Gordon