|
-
Sep 19th, 2001, 08:06 PM
#1
Thread Starter
Hyperactive Member
Is vb stupid or is it me?
Is vb stupid or is it me?Is vb stupid or is it me? Why aren't these actions interpreted correctly when you click away on the mouse? This is killing me - how do I remedy this!!!
Code:
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Debug.Print "mouse down"
End Sub
Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Debug.Print "mouse up"
End Sub
It prints this in the debug window:
mouse down
mouse up
mouse up
mouse down
mouse up
mouse up
mouse down
mouse up
mouse up
mouse down
mouse up
mouse up
-
Sep 19th, 2001, 08:10 PM
#2
Fanatic Member
It appears that VB is stupid, here is a solution however...
VB Code:
Private IsDown As Boolean
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
IsDown = True
Debug.Print "mouse down"
End Sub
Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If IsDown = True Then
Debug.Print "mouse up"
IsDown = False
End If
End Sub
{Insert random techno-babble here}
{Insert quote from some long gone mofo here}
-
Sep 19th, 2001, 08:40 PM
#3
Thread Starter
Hyperactive Member
Thanks for the vote of confidence, however I was hoping for a configuration fix or something. The code does the trick but leads me to another question and the urge to blow off some steam; If I have to write code to validate this procedure that was part of the vb package would I be better off using the API to get the button state which probably works without having to validate it in code? If that is in fact the case will I gain performance by using the API across the board and writing my own procedures?
-
Sep 19th, 2001, 08:55 PM
#4
What you are seeing is normal for a double click of the mouse. I have added a few more debug statements to show what is the normal sequence of events when you click on a picture box.
VB Code:
Private Sub Picture1_Click()
Debug.Print "Click"
End Sub
Private Sub Picture1_DblClick()
Debug.Print "Double Click"
End Sub
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Debug.Print
Debug.Print "Mouse down"
End Sub
Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Debug.Print "Mouse Up"
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
|