|
-
Dec 3rd, 2002, 11:20 PM
#1
Thread Starter
Addicted Member
Double Click
Is there a way to detect if you click on an object with both mousebuttons, like in minesweep to open all the surrounding spot?
-
Dec 4th, 2002, 03:31 AM
#2
Frenzied Member
yes, if you use MouseDown or MouseMove, the variable 'Button' is 3 if both buttons are pressed
-
Dec 4th, 2002, 05:33 PM
#3
Thread Starter
Addicted Member
If that's true, why doesn't the following code ever produce a msgbox?
Code:
Private Sub Command1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 3 Then
MsgBox ""
End If
End Sub
-
Dec 4th, 2002, 05:43 PM
#4
I testet it, and the mousdown event does not respond to double clicking....but you can make two variable LeftButton and RightButton, and check if both of them are true...
Something like this....
VB Code:
Option Explicit
Dim leftButton As Boolean
Dim rightButton As Boolean
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
leftButton = True
ElseIf Button = 2 Then
rightButton = True
End If
If leftButton = True And rightButton = True Then
Text1.Text = True
End If
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
leftButton = False
ElseIf Button = 2 Then
rightButton = False
End If
If leftButton = False Or rightButton = False Then
Text1.Text = False
End If
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|