Mouse Class
Represents the mouse device to a specific thread.
Assembly: PresentationCore (in PresentationCore.dll)
| 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 | |
|---|---|---|
![]() ![]() | 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.
Available since 3.0
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.




