Mouse Class
Represents the mouse device to a specific thread.
Assembly: PresentationCore (in PresentationCore.dll)
The Mouse type exposes the following members.
| Name | Description | |
|---|---|---|
![]() ![]() | Captured | Gets the element that has captured the mouse. |
![]() ![]() | DirectlyOver | Gets the element the mouse pointer is directly over. |
![]() ![]() | LeftButton | Gets the state of the left button of the mouse. |
![]() ![]() | MiddleButton | Gets the state of the middle button of the mouse. |
![]() ![]() | OverrideCursor | Gets or sets the cursor for the entire application. |
![]() ![]() | PrimaryDevice | Gets the primary mouse device. |
![]() ![]() | RightButton | Gets the state of the right button. |
![]() ![]() | XButton1 | Gets the state of the first extended button. |
![]() ![]() | XButton2 | Gets the state of the second extended button. |
| Name | Description | |
|---|---|---|
![]() ![]() | AddGotMouseCaptureHandler | Adds a handler for the GotMouseCapture attached event. |
![]() ![]() | AddLostMouseCaptureHandler | Adds a handler for the LostMouseCapture attached event. |
![]() ![]() | AddMouseDownHandler | Adds a handler for the MouseDown attached event. |
![]() ![]() | AddMouseEnterHandler | Adds a handler for the MouseEnter attached event. |
![]() ![]() | AddMouseLeaveHandler | Adds a handler for the MouseLeave attached event. |
![]() ![]() | AddMouseMoveHandler | Adds a handler for the MouseMove attached event. |
![]() ![]() | AddMouseUpHandler | Adds a handler for the MouseUp attached event. |
![]() ![]() | AddMouseWheelHandler | Adds a handler for the MouseWheel attached event. |
![]() ![]() | AddPreviewMouseDownHandler | Adds a handler for the PreviewMouseDown attached event. |
![]() ![]() | AddPreviewMouseDownOutsideCapturedElementHandler | Adds a handler for the PreviewMouseDownOutsideCapturedElement attached event. |
![]() ![]() | AddPreviewMouseMoveHandler | Adds a handler for the PreviewMouseMove attached event. |
![]() ![]() | AddPreviewMouseUpHandler | Adds a handler for the PreviewMouseUp attached event. |
![]() ![]() | AddPreviewMouseUpOutsideCapturedElementHandler | Adds a handler for the PreviewMouseUpOutsideCapturedElement attached event. |
![]() ![]() | AddPreviewMouseWheelHandler | Adds a handler for the PreviewMouseWheel attached event. |
![]() ![]() | AddQueryCursorHandler | Adds a handler for the QueryCursor attached event. |
![]() ![]() | Capture(IInputElement) | Captures mouse input to the specified element. |
![]() ![]() | Capture(IInputElement, CaptureMode) | Captures mouse input to the specified element using the specified CaptureMode. |
![]() ![]() | GetIntermediatePoints | Retrieves up to 64 previous coordinates of the mouse pointer since the last mouse move event. |
![]() ![]() | GetPosition | Gets the position of the mouse relative to a specified element. |
![]() ![]() | RemoveGotMouseCaptureHandler | Removes a handler for the GotMouseCapture attached event. |
![]() ![]() | RemoveLostMouseCaptureHandler | Removes a handler for the LostMouseCapture attached event. |
![]() ![]() | RemoveMouseDownHandler | Removes a handler for the MouseDown attached event. |
![]() ![]() | RemoveMouseEnterHandler | Removes a handler for the MouseEnter attached event. |
![]() ![]() | RemoveMouseLeaveHandler | Removes a handler for the MouseLeave attached event. |
![]() ![]() | RemoveMouseMoveHandler | Removes a handler for the MouseMove attached event. |
![]() ![]() | RemoveMouseUpHandler | Removes a handler for the MouseUp attached event. |
![]() ![]() | RemoveMouseWheelHandler | Removes a handler for the MouseWheel attached event. |
![]() ![]() | RemovePreviewMouseDownHandler | Removes a handler for the PreviewMouseDown attached event. |
![]() ![]() | RemovePreviewMouseDownOutsideCapturedElementHandler | Removes a handler for the PreviewMouseDownOutsideCapturedElement attached event. |
![]() ![]() | RemovePreviewMouseMoveHandler | Removes a handler for the PreviewMouseMove attached event. |
![]() ![]() | RemovePreviewMouseUpHandler | Removes a handler for the PreviewMouseUp attached event. |
![]() ![]() | RemovePreviewMouseUpOutsideCapturedElementHandler | Removes a handler for the PreviewMouseUpOutsideCapturedElement attached event. |
![]() ![]() | RemovePreviewMouseWheelHandler | Removes a handler for the PreviewMouseWheel attached event. |
![]() ![]() | RemoveQueryCursorHandler | Removes a handler for the QueryCursor attached event. |
![]() ![]() | SetCursor | Sets the mouse pointer to the specified Cursor. |
![]() ![]() | Synchronize | Forces the mouse to resynchronize. |
![]() ![]() | UpdateCursor | Forces the mouse cursor to be updated. |
| Name | Description | |
|---|---|---|
![]() | GotMouseCapture | Occurs when an element captures the mouse. |
![]() | LostMouseCapture | Occurs when an element loses mouse capture. |
![]() | MouseDown | Occurs when any mouse button is depressed. |
![]() | MouseEnter | Occurs when the mouse pointer enters the boundaries of an element. |
![]() | MouseLeave | Occurs when the mouse pointer leaves the boundaries of an element. |
![]() | MouseMove | Occurs when the mouse pointer moves. |
![]() | MouseUp | Occurs when any mouse button is released. |
![]() | MouseWheel | Occurs when the mouse wheel is rotated. |
![]() | PreviewMouseDown | Occurs when any mouse button is depressed. |
![]() | PreviewMouseDownOutsideCapturedElement | Occurs when the primary mouse button is pressed outside the element that is capturing mouse events. |
![]() | PreviewMouseMove | Occurs when the mouse moves over an element. |
![]() | PreviewMouseUp | Occurs when any mouse button is released. |
![]() | PreviewMouseUpOutsideCapturedElement | Occurs when the primary mouse button is released outside the element that is capturing mouse events. |
![]() | PreviewMouseWheel | Occurs when the mouse wheel rotates. |
![]() | QueryCursor | Occurs when an element queries for the current mouse cursor. |
The Mouse class provides mouse related events, methods and, properties which provide information regarding the state of the mouse.
Each event that Mouse defines as an attached event is also re-exposed by the base element classes UIElement and ContentElement as a new routed event. Generally, it is more convenient to handle mouse events for an application on UIElement and ContentElement, rather than using the Mouse events. For details, see Input Overview.
The static members of the Mouse class delegate to the primary MouseDevice of the calling thread's input manager.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
