Mouse Class
TOC
Collapse the table of content
Expand the table of content

Mouse Class

 

Represents the mouse device to a specific thread.

Namespace:   System.Windows.Input
Assembly:  PresentationCore (in PresentationCore.dll)

System.Object
  System.Windows.Input.Mouse

public static class Mouse

NameDescription
System_CAPS_pubpropertySystem_CAPS_staticCaptured

Gets the element that has captured the mouse.

System_CAPS_pubpropertySystem_CAPS_staticDirectlyOver

Gets the element the mouse pointer is directly over.

System_CAPS_pubpropertySystem_CAPS_staticLeftButton

Gets the state of the left button of the mouse.

System_CAPS_pubpropertySystem_CAPS_staticMiddleButton

Gets the state of the middle button of the mouse.

System_CAPS_pubpropertySystem_CAPS_staticOverrideCursor

Gets or sets the cursor for the entire application.

System_CAPS_pubpropertySystem_CAPS_staticPrimaryDevice

Gets the primary mouse device.

System_CAPS_pubpropertySystem_CAPS_staticRightButton

Gets the state of the right button.

System_CAPS_pubpropertySystem_CAPS_staticXButton1

Gets the state of the first extended button.

System_CAPS_pubpropertySystem_CAPS_staticXButton2

Gets the state of the second extended button.

NameDescription
System_CAPS_pubmethodSystem_CAPS_staticAddGotMouseCaptureHandler(DependencyObject, MouseEventHandler)

Adds a handler for the GotMouseCapture attached event.

System_CAPS_pubmethodSystem_CAPS_staticAddLostMouseCaptureHandler(DependencyObject, MouseEventHandler)

Adds a handler for the LostMouseCapture attached event.

System_CAPS_pubmethodSystem_CAPS_staticAddMouseDownHandler(DependencyObject, MouseButtonEventHandler)

Adds a handler for the MouseDown attached event.

System_CAPS_pubmethodSystem_CAPS_staticAddMouseEnterHandler(DependencyObject, MouseEventHandler)

Adds a handler for the MouseEnter attached event.

System_CAPS_pubmethodSystem_CAPS_staticAddMouseLeaveHandler(DependencyObject, MouseEventHandler)

Adds a handler for the MouseLeave attached event.

System_CAPS_pubmethodSystem_CAPS_staticAddMouseMoveHandler(DependencyObject, MouseEventHandler)

Adds a handler for the MouseMove attached event.

System_CAPS_pubmethodSystem_CAPS_staticAddMouseUpHandler(DependencyObject, MouseButtonEventHandler)

Adds a handler for the MouseUp attached event.

System_CAPS_pubmethodSystem_CAPS_staticAddMouseWheelHandler(DependencyObject, MouseWheelEventHandler)

Adds a handler for the MouseWheel attached event.

System_CAPS_pubmethodSystem_CAPS_staticAddPreviewMouseDownHandler(DependencyObject, MouseButtonEventHandler)

Adds a handler for the PreviewMouseDown attached event.

System_CAPS_pubmethodSystem_CAPS_staticAddPreviewMouseDownOutsideCapturedElementHandler(DependencyObject, MouseButtonEventHandler)

Adds a handler for the PreviewMouseDownOutsideCapturedElement attached event.

System_CAPS_pubmethodSystem_CAPS_staticAddPreviewMouseMoveHandler(DependencyObject, MouseEventHandler)

Adds a handler for the PreviewMouseMove attached event.

System_CAPS_pubmethodSystem_CAPS_staticAddPreviewMouseUpHandler(DependencyObject, MouseButtonEventHandler)

Adds a handler for the PreviewMouseUp attached event.

System_CAPS_pubmethodSystem_CAPS_staticAddPreviewMouseUpOutsideCapturedElementHandler(DependencyObject, MouseButtonEventHandler)

Adds a handler for the PreviewMouseUpOutsideCapturedElement attached event.

System_CAPS_pubmethodSystem_CAPS_staticAddPreviewMouseWheelHandler(DependencyObject, MouseWheelEventHandler)

Adds a handler for the PreviewMouseWheel attached event.

System_CAPS_pubmethodSystem_CAPS_staticAddQueryCursorHandler(DependencyObject, QueryCursorEventHandler)

Adds a handler for the QueryCursor attached event.

System_CAPS_pubmethodSystem_CAPS_staticCapture(IInputElement)

Captures mouse input to the specified element.

System_CAPS_pubmethodSystem_CAPS_staticCapture(IInputElement, CaptureMode)

Captures mouse input to the specified element using the specified CaptureMode.

System_CAPS_pubmethodSystem_CAPS_staticGetIntermediatePoints(IInputElement, Point[])

Retrieves up to 64 previous coordinates of the mouse pointer since the last mouse move event.

System_CAPS_pubmethodSystem_CAPS_staticGetPosition(IInputElement)

Gets the position of the mouse relative to a specified element.

System_CAPS_pubmethodSystem_CAPS_staticRemoveGotMouseCaptureHandler(DependencyObject, MouseEventHandler)

Removes a handler for the GotMouseCapture attached event.

System_CAPS_pubmethodSystem_CAPS_staticRemoveLostMouseCaptureHandler(DependencyObject, MouseEventHandler)

Removes a handler for the LostMouseCapture attached event.

System_CAPS_pubmethodSystem_CAPS_staticRemoveMouseDownHandler(DependencyObject, MouseButtonEventHandler)

Removes a handler for the MouseDown attached event.

System_CAPS_pubmethodSystem_CAPS_staticRemoveMouseEnterHandler(DependencyObject, MouseEventHandler)

Removes a handler for the MouseEnter attached event.

System_CAPS_pubmethodSystem_CAPS_staticRemoveMouseLeaveHandler(DependencyObject, MouseEventHandler)

Removes a handler for the MouseLeave attached event.

System_CAPS_pubmethodSystem_CAPS_staticRemoveMouseMoveHandler(DependencyObject, MouseEventHandler)

Removes a handler for the MouseMove attached event.

System_CAPS_pubmethodSystem_CAPS_staticRemoveMouseUpHandler(DependencyObject, MouseButtonEventHandler)

Removes a handler for the MouseUp attached event.

System_CAPS_pubmethodSystem_CAPS_staticRemoveMouseWheelHandler(DependencyObject, MouseWheelEventHandler)

Removes a handler for the MouseWheel attached event.

System_CAPS_pubmethodSystem_CAPS_staticRemovePreviewMouseDownHandler(DependencyObject, MouseButtonEventHandler)

Removes a handler for the PreviewMouseDown attached event.

System_CAPS_pubmethodSystem_CAPS_staticRemovePreviewMouseDownOutsideCapturedElementHandler(DependencyObject, MouseButtonEventHandler)

Removes a handler for the PreviewMouseDownOutsideCapturedElement attached event.

System_CAPS_pubmethodSystem_CAPS_staticRemovePreviewMouseMoveHandler(DependencyObject, MouseEventHandler)

Removes a handler for the PreviewMouseMove attached event.

System_CAPS_pubmethodSystem_CAPS_staticRemovePreviewMouseUpHandler(DependencyObject, MouseButtonEventHandler)

Removes a handler for the PreviewMouseUp attached event.

System_CAPS_pubmethodSystem_CAPS_staticRemovePreviewMouseUpOutsideCapturedElementHandler(DependencyObject, MouseButtonEventHandler)

Removes a handler for the PreviewMouseUpOutsideCapturedElement attached event.

System_CAPS_pubmethodSystem_CAPS_staticRemovePreviewMouseWheelHandler(DependencyObject, MouseWheelEventHandler)

Removes a handler for the PreviewMouseWheel attached event.

System_CAPS_pubmethodSystem_CAPS_staticRemoveQueryCursorHandler(DependencyObject, QueryCursorEventHandler)

Removes a handler for the QueryCursor attached event.

System_CAPS_pubmethodSystem_CAPS_staticSetCursor(Cursor)

Sets the mouse pointer to the specified Cursor.

System_CAPS_pubmethodSystem_CAPS_staticSynchronize()

Forces the mouse to resynchronize.

System_CAPS_pubmethodSystem_CAPS_staticUpdateCursor()

Forces the mouse cursor to be updated.

NameDescription
System_CAPS_pubfieldSystem_CAPS_staticGotMouseCaptureEvent

Identifies the GotMouseCapture attached event.

System_CAPS_pubfieldSystem_CAPS_staticLostMouseCaptureEvent

Identifies the LostMouseCapture attached event.

System_CAPS_pubfieldSystem_CAPS_staticMouseDownEvent

Identifies the MouseDown attached event.

System_CAPS_pubfieldSystem_CAPS_staticMouseEnterEvent

Identifies the MouseEnter attached event.

System_CAPS_pubfieldSystem_CAPS_staticMouseLeaveEvent

Identifies the MouseLeave attached event.

System_CAPS_pubfieldSystem_CAPS_staticMouseMoveEvent

Identifies the MouseMove attached event.

System_CAPS_pubfieldSystem_CAPS_staticMouseUpEvent

Identifies the MouseUp attached event.

System_CAPS_pubfieldSystem_CAPS_staticMouseWheelDeltaForOneLine

Represents the number of units the mouse wheel is rotated to scroll one line.

System_CAPS_pubfieldSystem_CAPS_staticMouseWheelEvent

Identifies the MouseWheel attached event.

System_CAPS_pubfieldSystem_CAPS_staticPreviewMouseDownEvent

Identifies the PreviewMouseDown attached event.

System_CAPS_pubfieldSystem_CAPS_staticPreviewMouseDownOutsideCapturedElementEvent

Identifies the PreviewMouseDownOutsideCapturedElement attached event.

System_CAPS_pubfieldSystem_CAPS_staticPreviewMouseMoveEvent

Identifies the PreviewMouseMove attached event.

System_CAPS_pubfieldSystem_CAPS_staticPreviewMouseUpEvent

Identifies the PreviewMouseUp attached event.

System_CAPS_pubfieldSystem_CAPS_staticPreviewMouseUpOutsideCapturedElementEvent

Identifies the PreviewMouseUpOutsideCapturedElement attached event.

System_CAPS_pubfieldSystem_CAPS_staticPreviewMouseWheelEvent

Identifies the PreviewMouseWheel attached event.

System_CAPS_pubfieldSystem_CAPS_staticQueryCursorEvent

Identifies the QueryCursor attached event.

NameDescription
System_CAPS_pubeventSystem_CAPS_staticGotMouseCapture

Occurs when an element captures the mouse.

System_CAPS_pubeventSystem_CAPS_staticLostMouseCapture

Occurs when an element loses mouse capture.

System_CAPS_pubeventSystem_CAPS_staticMouseDown

Occurs when any mouse button is depressed.

System_CAPS_pubeventSystem_CAPS_staticMouseEnter

Occurs when the mouse pointer enters the boundaries of an element.

System_CAPS_pubeventSystem_CAPS_staticMouseLeave

Occurs when the mouse pointer leaves the boundaries of an element.

System_CAPS_pubeventSystem_CAPS_staticMouseMove

Occurs when the mouse pointer moves.

System_CAPS_pubeventSystem_CAPS_staticMouseUp

Occurs when any mouse button is released.

System_CAPS_pubeventSystem_CAPS_staticMouseWheel

Occurs when the mouse wheel is rotated.

System_CAPS_pubeventSystem_CAPS_staticPreviewMouseDown

Occurs when any mouse button is depressed.

System_CAPS_pubeventSystem_CAPS_staticPreviewMouseDownOutsideCapturedElement

Occurs when the primary mouse button is pressed outside the element that is capturing mouse events.

System_CAPS_pubeventSystem_CAPS_staticPreviewMouseMove

Occurs when the mouse moves over an element.

System_CAPS_pubeventSystem_CAPS_staticPreviewMouseUp

Occurs when any mouse button is released.

System_CAPS_pubeventSystem_CAPS_staticPreviewMouseUpOutsideCapturedElement

Occurs when the primary mouse button is released outside the element that is capturing mouse events.

System_CAPS_pubeventSystem_CAPS_staticPreviewMouseWheel

Occurs when the mouse wheel rotates.

System_CAPS_pubeventSystem_CAPS_staticQueryCursor

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.

.NET Framework
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.

Return to top
Show:
© 2016 Microsoft