When you click a native MS control quickly, and then suddenly stop clicking and hold the mouse down, the control will always reflect the mouse down. In all your controls, this is not the case: Sometimes the control shows a down state, sometimes and up state.
Edit: Well, I must be fair: The MS combo also has this bug...
Up-down problem in all controls
Re: Up-down problem in all controls
Yeah, I know. But I have absolutly no clue why this is happening.
Crunching for Fab36_Folding-Division at Folding@Home. Join Fab36/Fab30! - Folding@Home and BOINC
Boycott DRM! Boycott HDCP!
Boycott DRM! Boycott HDCP!
Re: Up-down problem in all controls
This is a known behaviour which confuses some people.
Post this code into a form:
Option Explicit
Private bDown As Boolean
Private Sub Form_DblClick()
Debug.Print "dblclick"
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Debug.Print "down"
bDown = True
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Debug.Print "up"
Debug.Assert bDown
bDown = False
End Sub
Now click quickly on the form.
The code will stop here:
down
up
dblclick
up
You see?
I cannot see your code, but I think you assume that when the event "DblClick" occured, the mouse is always up (which doesn't have to be the case).
Post this code into a form:
Option Explicit
Private bDown As Boolean
Private Sub Form_DblClick()
Debug.Print "dblclick"
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Debug.Print "down"
bDown = True
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Debug.Print "up"
Debug.Assert bDown
bDown = False
End Sub
Now click quickly on the form.
The code will stop here:
down
up
dblclick
up
You see?
I cannot see your code, but I think you assume that when the event "DblClick" occured, the mouse is always up (which doesn't have to be the case).
Re: Up-down problem in all controls
It's not that easy.
First, the events simply reflect the messages sent to the control window by Windows. So if you see an event sequence of Down, Up, DblClick, Up, this means that the control window received WM_LBUTTONDOWN, WM_LBUTTONUP, WM_LBUTTONDBLCLK, WM_LBUTTONUP. If I remember correctly, this message sequence is the same for a trivial C++ app (dialog + button), which does nothing more than logging the messages the button receives. So there's nothing wrong with the events.
Second, the button (and any other control of mine) is drawn by Windows, not by my code. The internal state (down/up) of the button is also managed by Windows. So the wrong state seems to be Windows' fault. On the other hand, I cannot reproduce this behavior with a C++ app, so it really seems to be my code that's wrong.
First, the events simply reflect the messages sent to the control window by Windows. So if you see an event sequence of Down, Up, DblClick, Up, this means that the control window received WM_LBUTTONDOWN, WM_LBUTTONUP, WM_LBUTTONDBLCLK, WM_LBUTTONUP. If I remember correctly, this message sequence is the same for a trivial C++ app (dialog + button), which does nothing more than logging the messages the button receives. So there's nothing wrong with the events.
Second, the button (and any other control of mine) is drawn by Windows, not by my code. The internal state (down/up) of the button is also managed by Windows. So the wrong state seems to be Windows' fault. On the other hand, I cannot reproduce this behavior with a C++ app, so it really seems to be my code that's wrong.
Crunching for Fab36_Folding-Division at Folding@Home. Join Fab36/Fab30! - Folding@Home and BOINC
Boycott DRM! Boycott HDCP!
Boycott DRM! Boycott HDCP!