|
-
Oct 26th, 2002, 04:38 PM
#1
Thread Starter
Lively Member
Right Clicking performing Left Click as well
I am right clicking on a listview to have it popup a menu, BUT I also want it to select the listitem that you have right clicked on, essentially I want the right click to perform the left click action before the right click action. I have tried calling the Listview1_Click function, but does not work. Shed some light somebody?
I am detecting the right click by the MouseDown function, perhaps this is causing my problem, how do I detect a right mouse click in a Click function (Listview1_Click)
Thanks buddies
Last edited by Daniel McCool; Oct 26th, 2002 at 04:42 PM.
"Some love is fire, some love is rust. But the finest, cleanest love is lust." - James Bond
-
Oct 26th, 2002, 05:01 PM
#2
Frenzied Member
Does this help???
VB Code:
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbRightButton Then MsgBox "Right Click is pressed."
End Sub
-
Oct 26th, 2002, 05:07 PM
#3
Frenzied Member
VB Code:
'In decarations area
' HOLDS ITEM SELECTED IN LISTBOX
Private M_CURRENTITEM As ListItem
'*******************************************************************************
' ListView1_MouseDown (SUB)
'
' DESCRIPTION:
' STORE ITEM SELECTED
'*******************************************************************************
Private Sub ListView1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Set M_CURRENTITEM = ListView1.HitTest(X, Y)
End Sub
'*******************************************************************************
' ListView1_DblClick (SUB)
'
' DESCRIPTION:
' LAUNCH APPLICATION SELECTED
'*******************************************************************************
Private Sub ListView1_DblClick()
If M_CURRENTITEM Is Nothing Then
MsgBox "Select a Task to Perform"
Else
' DO THE ACTION ASSOCIATED WITH THE BUTTON SELECTED
Select Case M_CURRENTITEM
Case "Icon Caption 1"
Case "Icon Caption 1"
Case "Icon Caption 1"
End Select
End If
End Sub
-
Oct 26th, 2002, 05:27 PM
#4
Thread Starter
Lively Member
Yes this helps, thank you sir
Last edited by Daniel McCool; Oct 26th, 2002 at 05:37 PM.
"Some love is fire, some love is rust. But the finest, cleanest love is lust." - James Bond
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
|