Is there a way of getting the node clicked at in a class MSComctlLib.TreeCtrl.2 treeview, when a right mouse click event occurs?
Methods available include TV_nodeClick(ByVal node As Object) which clearly supplies the node clicked on, and TV_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Long, ByVal y As Long) which clearly does not supply the node, but only the coordinates.
So how can I derive the node right-clicked on?
Is there a way of getting the node clicked at in a class MSComctlLib.TreeCtrl.2
Share
Found it myself! I checked method list and found an interesting one: hitTest. This transforms x,y into a node; of course a check has to be added to see that a node has been determined.
Sample code: