troubleshooting Question

TreeView 6.0 for Excel 2010. How to trap the mouse button that clicks a node AND get the KEY of the node that is clicked?

Avatar of Kelvin4
Kelvin4 asked on
Visual Basic Classic
9 Comments2 Solutions126 ViewsLast Modified:
In Excel 2010, using VB6.0 TreeView (and NOT using .NET) ... in the TreeView control named tv_CI, I can identify the MOUSE BUTTON that clicked a tv_cI.node via:

Private Sub tv_CI_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As stdole.OLE_XPOS_PIXELS, ByVal y As stdole.OLE_YPOS_PIXELS)
 'my code...
End Sub

To identify the node clicked, I can use:

Private Sub tv_CI_NodeClick(ByVal Node As MSComctlLib.Node)
 'my code...
End Sub

When these procedures are used together in the same UserForm code, _Mousedown takes precedence and _Nodeclicked does not fire.

How can I gain both the Button value and the Node key when the node is clicked?

Join our community to see this answer!
Unlock 2 Answers and 9 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 9 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros