Mouse Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents the mouse device to a specific thread.
public ref class Mouse abstract sealed
public static class Mouse
type Mouse = class
Public Class Mouse
- Inheritance
-
Mouse
Remarks
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.
Fields
GotMouseCaptureEvent |
Identifies the GotMouseCapture attached event. |
LostMouseCaptureEvent |
Identifies the LostMouseCapture attached event. |
MouseDownEvent |
Identifies the MouseDown attached event. |
MouseEnterEvent |
Identifies the MouseEnter attached event. |
MouseLeaveEvent |
Identifies the MouseLeave attached event. |
MouseMoveEvent |
Identifies the MouseMove attached event. |
MouseUpEvent |
Identifies the MouseUp attached event. |
MouseWheelDeltaForOneLine |
Represents the number of units the mouse wheel is rotated to scroll one line. |
MouseWheelEvent |
Identifies the MouseWheel attached event. |
PreviewMouseDownEvent |
Identifies the PreviewMouseDown attached event. |
PreviewMouseDownOutsideCapturedElementEvent |
Identifies the PreviewMouseDownOutsideCapturedElement attached event. |
PreviewMouseMoveEvent |
Identifies the PreviewMouseMove attached event. |
PreviewMouseUpEvent |
Identifies the PreviewMouseUp attached event. |
PreviewMouseUpOutsideCapturedElementEvent |
Identifies the PreviewMouseUpOutsideCapturedElement attached event. |
PreviewMouseWheelEvent |
Identifies the PreviewMouseWheel attached event. |
QueryCursorEvent |
Identifies the QueryCursor attached event. |
Properties
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. |
Methods
Attached Events
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. |