Link to home
Start Free TrialLog in
Avatar of Matt_Unsworth
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.
ASKER CERTIFIED SOLUTION
Avatar of Vbmaster
Vbmaster

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You cannot assign a seperate event to each Node. You have to use the events provided.

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
Avatar of Matt_Unsworth
Matt_Unsworth

ASKER

Thanks,

Matt