Results 1 to 5 of 5

Thread: doubleclick question

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Posts
    94
    Is there a way to determine which mouse button is causing the doubleclick? I have an imagebox that displays the image full size in another form upon doubleclick. However it responds to a double click of the right mouse button as well as left, and I only want the left doubleclick.

  2. #2
    Guest
    Try:

    Code:
    Private Sub Image1_DblClick()
    If Button = 1 Then
    'code
    End If
    End Sub

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Posts
    94
    Button is not defined for doubleclick or click. Only MouseDown, MouseUp, and MouseMove. Any other ideas?

  4. #4
    Hyperactive Member
    Join Date
    Nov 1999
    Posts
    363
    This worked for me:
    Code:
    Option Explicit
    Private Const cnMsLft = 1
    Private Const cnMsRt = 2
    Private bMsClck As Byte
    
    Private Sub Image1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
        Select Case Button
            Case 1
                bMsClck = 1
            Case 2
                bMsClck = 2
        End Select
    End Sub
    
    Private Sub Image1_DblClick()
        If bMsClck = 2 Then
            MsgBox "DblClick Right"
            'DblClick Processing
        End If
    End Sub
    Wade

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Posts
    94

    Thumbs up

    Thats an idea I hadn't thought of. Thanks

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