Results 1 to 4 of 4

Thread: Right Clicking performing Left Click as well

  1. #1

    Thread Starter
    Lively Member Daniel McCool's Avatar
    Join Date
    Oct 2002
    Posts
    127

    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

  2. #2
    Frenzied Member mxnmx's Avatar
    Join Date
    Dec 2001
    Location
    I'm back...now!!!
    Posts
    1,396
    Does this help???

    VB Code:
    1. Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    2.     If Button = vbRightButton Then MsgBox "Right Click is pressed."
    3. End Sub
    Can't Remember Birthdays or Important Dates- Never Miss any Important Date(s)

  3. #3
    Frenzied Member mxnmx's Avatar
    Join Date
    Dec 2001
    Location
    I'm back...now!!!
    Posts
    1,396
    VB Code:
    1. 'In decarations area
    2.  
    3. ' HOLDS ITEM SELECTED IN LISTBOX
    4.  
    5. Private M_CURRENTITEM As ListItem
    6.  
    7. '*******************************************************************************
    8. ' ListView1_MouseDown (SUB)
    9. '
    10. ' DESCRIPTION:
    11. ' STORE ITEM SELECTED
    12. '*******************************************************************************
    13.  
    14. Private Sub ListView1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    15.    
    16.     Set M_CURRENTITEM = ListView1.HitTest(X, Y)
    17.    
    18. End Sub
    19.  
    20. '*******************************************************************************
    21. ' ListView1_DblClick (SUB)
    22. '
    23. ' DESCRIPTION:
    24. ' LAUNCH APPLICATION SELECTED
    25. '*******************************************************************************
    26.  
    27. Private Sub ListView1_DblClick()
    28.    
    29.     If M_CURRENTITEM Is Nothing Then
    30.        
    31.         MsgBox "Select a Task to Perform"
    32.        
    33.     Else
    34.  
    35.         ' DO THE ACTION ASSOCIATED WITH THE BUTTON SELECTED
    36.  
    37.         Select Case M_CURRENTITEM
    38.  
    39.             Case "Icon Caption 1"
    40.  
    41.             Case "Icon Caption 1"
    42.  
    43.             Case "Icon Caption 1"
    44.  
    45.        End Select
    46.        
    47.     End If
    48.    
    49. End Sub
    Can't Remember Birthdays or Important Dates- Never Miss any Important Date(s)

  4. #4

    Thread Starter
    Lively Member Daniel McCool's Avatar
    Join Date
    Oct 2002
    Posts
    127
    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
  •  



Click Here to Expand Forum to Full Width