We help IT Professionals succeed at work.
Get Started

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?

Kelvin4 asked
Last Modified: 2016-02-22
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?

Watch Question
Top Expert 2016
This problem has been solved!
Unlock 2 Answers and 9 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE