Results 1 to 3 of 3

Thread: Detect mouse click !

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Location
    Or
    Posts
    316
    I answered a question like this the other day. (At least it would do what you are looking for, but does require subclassing your window). Anyway, if you are interested, take a look at this thread

    Hope this helps.

  2. #2
    Junior Member
    Join Date
    Aug 2000
    Posts
    18
    Thanks Matthew + reeset, I think Matthews code is alot simpler and shorter =) !


  3. #3
    Guest
    Here's how to distinguish the mouse buttons.
    Code:
    Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
    
    Private Sub Form_Load()
        Timer1.Interval = 1
    End Sub
    
    Private Sub Timer1_Timer()
        If GetAsyncKeyState(vbLeftButton) Then Print "Left Button"
        If GetAsyncKeyState(vbRightButton) Then Print "Right Button"
        If GetAsyncKeyState(vbMiddleButton) Then Print "Middle Button"
    End Sub

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