3

Oops, I have a lot of questions that can't find answers to them in Google. Everybody is just using codes, and nobody explains their purposes. What does Mouse.Captured mean? And What does Mouse.Capture() do? And (sorry the last one) when LostMouseCapture occurs?

2
  • 1
    The docs explain it pretty simply. "When an element captures the mouse, it receives mouse input whether or not the cursor is within its borders. The mouse is typically captured in this manner only during drag-and-drop operations, and retains capture until the drop action of the drag-and-drop operation occurs." What is confusing about that?
    – user1228
    Commented Aug 9, 2013 at 17:19
  • Does this answer your question? What does it mean to "Capture the mouse" in WPF? Commented Mar 18, 2020 at 21:01

1 Answer 1

3

Basically, if you call Mouse.Capture and pass in a input element, that input element (control) will always receive the mouse events, even if the mouse is outside of the bounds of the control.

The documentation is clear:

When an element captures the mouse, it receives mouse input whether or not the cursor is within its borders.

Mouse.Captured just lets you see if an input element has the mouse captured, and LostMouseCapture occurs when the capturing stops.

0

Not the answer you're looking for? Browse other questions tagged or ask your own question.