-
Hi.. I am using a treeview ctrl to deslpay some data. I want to add a right-click functionality to those nodes only which do not have children !
I am using this code (which is not working):
---------
Private Sub treeview_MouseDown(Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)
If Button = vbRightButton Then
If treeview.SelectedItem.Children > 0 Then
Exit Sub
Else
PopupMenu mnuRecords
End If
End If
End Sub
---------
What am I doing wrong?
-
Hi,
Use the MouseUp event instead of the MouseDown event and that will solve your problem.
Hope this helps
Shaun
-
thanks for the quick reply...
I have used the mousedown and not the mouseup b'cos I have noticed a weird behavior with this..that is I have to dbl-right-click to show the popup!!!
anyway...
I will rephrase the problem in another thread in order to work it out in another way!
-
Hi,
There must be a problem with some other of your code then because, trust me, detecting a right-click through the mouseup event to make a popupmenu appear does not require a double-click. ;)
Promise!!!