What does it mean to “Capture the mouse” in WPF?

From Capture and Uncapture the Mouse on MSDN:

When an object captures the mouse, all mouse related events are treated as if the object with mouse capture perform the event, even if the mouse pointer is over another object.

Only the capturing control receives the mouse events until released.

Capturing the mouse is useful for dragging because all the dragging code can exist in the one control, rather than being spread over multiple controls.

Leave a Comment