Results 1 to 3 of 3

Thread: [RESOLVED] If Mouse_click Then OR If Mouse_dblClick Then

  1. #1

    Thread Starter
    Hyperactive Member stilekid007's Avatar
    Join Date
    Apr 2005
    Location
    DUDE! I'm your neighbor! HELLO!!!
    Posts
    388

    Resolved [RESOLVED] If Mouse_click Then OR If Mouse_dblClick Then

    Hey guys,

    I am using this program that I downloaded from this forum. What I need it to do though is when the system tray icon is clicked it will Hide the form and when it is double clicked it will show the popup menu.

    Here is the code that brings up the popup menu.

    VB Code:
    1. Private Sub picIcon_MouseUp(index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)
    2.     ' Messages from the systray will be passed here.    On Error GoTo BadMenu
    3.     Dim Msg As Long
    4.    
    5.     Msg = x / Screen.TwipsPerPixelX
    6.     Select Case Msg
    7.         Case WM_LBUTTONUP, WM_LBUTTONDBLCLK, WM_RBUTTONUP
    8.             PopupMenu mnuPopup
    9.     End Select
    10. End Sub

    How can I make this work?

    Thank you everyone!
    Stilekid007
    Quote Originally Posted by stilekid007
    I RATE ALL HELPFULL POSTS!

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: If Mouse_click Then OR If Mouse_dblClick Then

    Just change the Select Case block to this:
    VB Code:
    1. Select Case Msg
    2.         Case WM_LBUTTONUP
    3.             Me.Hide
    4.         Case WM_LBUTTONDBLCLK
    5.             PopupMenu mnuPopup
    6.     End Select

  3. #3

    Thread Starter
    Hyperactive Member stilekid007's Avatar
    Join Date
    Apr 2005
    Location
    DUDE! I'm your neighbor! HELLO!!!
    Posts
    388

    Re: If Mouse_click Then OR If Mouse_dblClick Then

    Very simple!
    That's great!
    Thank you Geek!

    Stilekid007
    Quote Originally Posted by stilekid007
    I RATE ALL HELPFULL POSTS!

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