#692 – Common Controls Typically Do Not Capture the Mouse
November 16, 2012 2 Comments
It’s a convention within Windows that controls typically do not capture the mouse after they intercept a mouse down event. For example, you click on a Button by pressing and releasing the left mouse button. But if you press the left mouse button, and then move the mouse pointer off the button before releasing, the mouse will not get clicked.
Avoiding a mouse capture in this case allows the user to avoid a click action after inadvertently pressing the left mouse button down over the wrong user interface element.
Pingback: Dew Drop – November 16, 2012 (#1,444) | Alvin Ashcraft's Morning Dew
Hello Sean,
one question about a possible usage of Mouse Capture: Drag Drop..
As far as I know the left mouse button must be pressed and moved to start the drag.
(move threshold via SystemParameters.MinimumHorizontalDragDistance, …)
But if the mouse button will be pressed near to the margin of the drag item (e.g. list box, list box item) and directly moved outside of the item the minimum mouse move will not be detected on the item.
Now the question:
Does it make sense to use mouse capture to avoid the problem?
Is it a good idea to use the mouse capture while the mouse button is pressed to detect the distance?
If yes, are there disadvantages?
Best regards,
stefan