|
-
Sep 30th, 2000, 01:25 PM
#1
Thread Starter
Junior Member
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?
-
Sep 30th, 2000, 01:35 PM
#2
Addicted Member
Hi,
Use the MouseUp event instead of the MouseDown event and that will solve your problem.
Hope this helps
Shaun
Web/Application Developer
VB6 Ent (SP5), Win 2000,SQL Server 2000
-
Sep 30th, 2000, 01:52 PM
#3
Thread Starter
Junior Member
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!
-
Sep 30th, 2000, 03:20 PM
#4
Addicted Member
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!!!
Web/Application Developer
VB6 Ent (SP5), Win 2000,SQL Server 2000
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|