Mouse Mouse Mouse Mouse Class

Definición

Representa el dispositivo de mouse en un subproceso concreto.Represents the mouse device to a specific thread.

public ref class Mouse abstract sealed
public static class Mouse
type Mouse = class
Public Class Mouse
Herencia
MouseMouseMouseMouse

Comentarios

La Mouse clase proporciona eventos, métodos y propiedades relacionados con el mouse que proporcionan información sobre el estado del mouse.The Mouse class provides mouse related events, methods and, properties which provide information regarding the state of the mouse.

Cada evento que Mouse define como un evento adjunto también se vuelve a exponer mediante las clases UIElement de elementos base ContentElement y como un nuevo evento enrutado.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. Por lo general, es más conveniente controlar los eventos del mouse para una UIElement aplicación ContentElementen y, en lugar Mouse de usar los eventos.Generally, it is more convenient to handle mouse events for an application on UIElement and ContentElement, rather than using the Mouse events. Para obtener más información, consulte Introducción a la entrada.For details, see Input Overview.

Los miembros estáticos de Mouse la clase delegan en MouseDevice la principal del administrador de entrada del subproceso que realiza la llamada.The static members of the Mouse class delegate to the primary MouseDevice of the calling thread's input manager.

Campos

GotMouseCaptureEvent GotMouseCaptureEvent GotMouseCaptureEvent GotMouseCaptureEvent

Identifica el evento adjunto GotMouseCapture.Identifies the GotMouseCapture attached event.

LostMouseCaptureEvent LostMouseCaptureEvent LostMouseCaptureEvent LostMouseCaptureEvent

Identifica el evento adjunto LostMouseCapture.Identifies the LostMouseCapture attached event.

MouseDownEvent MouseDownEvent MouseDownEvent MouseDownEvent

Identifica el evento adjunto MouseDown.Identifies the MouseDown attached event.

MouseEnterEvent MouseEnterEvent MouseEnterEvent MouseEnterEvent

Identifica el evento adjunto MouseEnter.Identifies the MouseEnter attached event.

MouseLeaveEvent MouseLeaveEvent MouseLeaveEvent MouseLeaveEvent

Identifica el evento adjunto MouseLeave.Identifies the MouseLeave attached event.

MouseMoveEvent MouseMoveEvent MouseMoveEvent MouseMoveEvent

Identifica el evento adjunto MouseMove.Identifies the MouseMove attached event.

MouseUpEvent MouseUpEvent MouseUpEvent MouseUpEvent

Identifica el evento adjunto MouseUp.Identifies the MouseUp attached event.

MouseWheelDeltaForOneLine MouseWheelDeltaForOneLine MouseWheelDeltaForOneLine MouseWheelDeltaForOneLine

Representa el número de unidades que debe girar la rueda del mouse para desplazarse una línea.Represents the number of units the mouse wheel is rotated to scroll one line.

MouseWheelEvent MouseWheelEvent MouseWheelEvent MouseWheelEvent

Identifica el evento adjunto MouseWheel.Identifies the MouseWheel attached event.

PreviewMouseDownEvent PreviewMouseDownEvent PreviewMouseDownEvent PreviewMouseDownEvent

Identifica el evento adjunto PreviewMouseDown.Identifies the PreviewMouseDown attached event.

PreviewMouseDownOutsideCapturedElementEvent PreviewMouseDownOutsideCapturedElementEvent PreviewMouseDownOutsideCapturedElementEvent PreviewMouseDownOutsideCapturedElementEvent

Identifica el evento adjunto PreviewMouseDownOutsideCapturedElement.Identifies the PreviewMouseDownOutsideCapturedElement attached event.

PreviewMouseMoveEvent PreviewMouseMoveEvent PreviewMouseMoveEvent PreviewMouseMoveEvent

Identifica el evento adjunto PreviewMouseMove.Identifies the PreviewMouseMove attached event.

PreviewMouseUpEvent PreviewMouseUpEvent PreviewMouseUpEvent PreviewMouseUpEvent

Identifica el evento adjunto PreviewMouseUp.Identifies the PreviewMouseUp attached event.

PreviewMouseUpOutsideCapturedElementEvent PreviewMouseUpOutsideCapturedElementEvent PreviewMouseUpOutsideCapturedElementEvent PreviewMouseUpOutsideCapturedElementEvent

Identifica el evento adjunto PreviewMouseUpOutsideCapturedElement.Identifies the PreviewMouseUpOutsideCapturedElement attached event.

PreviewMouseWheelEvent PreviewMouseWheelEvent PreviewMouseWheelEvent PreviewMouseWheelEvent

Identifica el evento adjunto PreviewMouseWheel.Identifies the PreviewMouseWheel attached event.

QueryCursorEvent QueryCursorEvent QueryCursorEvent QueryCursorEvent

Identifica el evento adjunto QueryCursor.Identifies the QueryCursor attached event.

Propiedades

Captured Captured Captured Captured

Obtiene el elemento que ha capturado el mouse.Gets the element that has captured the mouse.

DirectlyOver DirectlyOver DirectlyOver DirectlyOver

Obtiene el elemento sobre el que se encuentra el puntero del mouse.Gets the element the mouse pointer is directly over.

LeftButton LeftButton LeftButton LeftButton

Obtiene el estado del botón primario del mouse.Gets the state of the left button of the mouse.

MiddleButton MiddleButton MiddleButton MiddleButton

Obtiene el estado del botón central del mouse.Gets the state of the middle button of the mouse.

OverrideCursor OverrideCursor OverrideCursor OverrideCursor

Obtiene o establece el cursor en toda la aplicación.Gets or sets the cursor for the entire application.

PrimaryDevice PrimaryDevice PrimaryDevice PrimaryDevice

Obtiene el dispositivo de mouse primario.Gets the primary mouse device.

RightButton RightButton RightButton RightButton

Obtiene el estado del botón secundario.Gets the state of the right button.

XButton1 XButton1 XButton1 XButton1

Obtiene el estado del primer botón extendido.Gets the state of the first extended button.

XButton2 XButton2 XButton2 XButton2

Obtiene el estado del segundo botón extendido.Gets the state of the second extended button.

Métodos

AddGotMouseCaptureHandler(DependencyObject, MouseEventHandler) AddGotMouseCaptureHandler(DependencyObject, MouseEventHandler) AddGotMouseCaptureHandler(DependencyObject, MouseEventHandler) AddGotMouseCaptureHandler(DependencyObject, MouseEventHandler)

Agrega un controlador para el evento adjunto GotMouseCapture .Adds a handler for the GotMouseCapture attached event.

AddLostMouseCaptureHandler(DependencyObject, MouseEventHandler) AddLostMouseCaptureHandler(DependencyObject, MouseEventHandler) AddLostMouseCaptureHandler(DependencyObject, MouseEventHandler) AddLostMouseCaptureHandler(DependencyObject, MouseEventHandler)

Agrega un controlador para el evento adjunto LostMouseCapture .Adds a handler for the LostMouseCapture attached event.

AddMouseDownHandler(DependencyObject, MouseButtonEventHandler) AddMouseDownHandler(DependencyObject, MouseButtonEventHandler) AddMouseDownHandler(DependencyObject, MouseButtonEventHandler) AddMouseDownHandler(DependencyObject, MouseButtonEventHandler)

Agrega un controlador para el evento adjunto MouseDown .Adds a handler for the MouseDown attached event.

AddMouseEnterHandler(DependencyObject, MouseEventHandler) AddMouseEnterHandler(DependencyObject, MouseEventHandler) AddMouseEnterHandler(DependencyObject, MouseEventHandler) AddMouseEnterHandler(DependencyObject, MouseEventHandler)

Agrega un controlador para el evento adjunto MouseEnter .Adds a handler for the MouseEnter attached event.

AddMouseLeaveHandler(DependencyObject, MouseEventHandler) AddMouseLeaveHandler(DependencyObject, MouseEventHandler) AddMouseLeaveHandler(DependencyObject, MouseEventHandler) AddMouseLeaveHandler(DependencyObject, MouseEventHandler)

Agrega un controlador para el evento adjunto MouseLeave .Adds a handler for the MouseLeave attached event.

AddMouseMoveHandler(DependencyObject, MouseEventHandler) AddMouseMoveHandler(DependencyObject, MouseEventHandler) AddMouseMoveHandler(DependencyObject, MouseEventHandler) AddMouseMoveHandler(DependencyObject, MouseEventHandler)

Agrega un controlador para el evento adjunto MouseMove .Adds a handler for the MouseMove attached event.

AddMouseUpHandler(DependencyObject, MouseButtonEventHandler) AddMouseUpHandler(DependencyObject, MouseButtonEventHandler) AddMouseUpHandler(DependencyObject, MouseButtonEventHandler) AddMouseUpHandler(DependencyObject, MouseButtonEventHandler)

Agrega un controlador para el evento adjunto MouseUp .Adds a handler for the MouseUp attached event.

AddMouseWheelHandler(DependencyObject, MouseWheelEventHandler) AddMouseWheelHandler(DependencyObject, MouseWheelEventHandler) AddMouseWheelHandler(DependencyObject, MouseWheelEventHandler) AddMouseWheelHandler(DependencyObject, MouseWheelEventHandler)

Agrega un controlador para el evento adjunto MouseWheel .Adds a handler for the MouseWheel attached event.

AddPreviewMouseDownHandler(DependencyObject, MouseButtonEventHandler) AddPreviewMouseDownHandler(DependencyObject, MouseButtonEventHandler) AddPreviewMouseDownHandler(DependencyObject, MouseButtonEventHandler) AddPreviewMouseDownHandler(DependencyObject, MouseButtonEventHandler)

Agrega un controlador para el evento adjunto PreviewMouseDown .Adds a handler for the PreviewMouseDown attached event.

AddPreviewMouseDownOutsideCapturedElementHandler(DependencyObject, MouseButtonEventHandler) AddPreviewMouseDownOutsideCapturedElementHandler(DependencyObject, MouseButtonEventHandler) AddPreviewMouseDownOutsideCapturedElementHandler(DependencyObject, MouseButtonEventHandler) AddPreviewMouseDownOutsideCapturedElementHandler(DependencyObject, MouseButtonEventHandler)

Agrega un controlador para el evento adjunto PreviewMouseDownOutsideCapturedElement .Adds a handler for the PreviewMouseDownOutsideCapturedElement attached event.

AddPreviewMouseMoveHandler(DependencyObject, MouseEventHandler) AddPreviewMouseMoveHandler(DependencyObject, MouseEventHandler) AddPreviewMouseMoveHandler(DependencyObject, MouseEventHandler) AddPreviewMouseMoveHandler(DependencyObject, MouseEventHandler)

Agrega un controlador para el evento adjunto PreviewMouseMove .Adds a handler for the PreviewMouseMove attached event.

AddPreviewMouseUpHandler(DependencyObject, MouseButtonEventHandler) AddPreviewMouseUpHandler(DependencyObject, MouseButtonEventHandler) AddPreviewMouseUpHandler(DependencyObject, MouseButtonEventHandler) AddPreviewMouseUpHandler(DependencyObject, MouseButtonEventHandler)

Agrega un controlador para el evento adjunto PreviewMouseUp .Adds a handler for the PreviewMouseUp attached event.

AddPreviewMouseUpOutsideCapturedElementHandler(DependencyObject, MouseButtonEventHandler) AddPreviewMouseUpOutsideCapturedElementHandler(DependencyObject, MouseButtonEventHandler) AddPreviewMouseUpOutsideCapturedElementHandler(DependencyObject, MouseButtonEventHandler) AddPreviewMouseUpOutsideCapturedElementHandler(DependencyObject, MouseButtonEventHandler)

Agrega un controlador para el evento adjunto PreviewMouseUpOutsideCapturedElement .Adds a handler for the PreviewMouseUpOutsideCapturedElement attached event.

AddPreviewMouseWheelHandler(DependencyObject, MouseWheelEventHandler) AddPreviewMouseWheelHandler(DependencyObject, MouseWheelEventHandler) AddPreviewMouseWheelHandler(DependencyObject, MouseWheelEventHandler) AddPreviewMouseWheelHandler(DependencyObject, MouseWheelEventHandler)

Agrega un controlador para el evento adjunto PreviewMouseWheel .Adds a handler for the PreviewMouseWheel attached event.

AddQueryCursorHandler(DependencyObject, QueryCursorEventHandler) AddQueryCursorHandler(DependencyObject, QueryCursorEventHandler) AddQueryCursorHandler(DependencyObject, QueryCursorEventHandler) AddQueryCursorHandler(DependencyObject, QueryCursorEventHandler)

Agrega un controlador para el evento adjunto QueryCursor.Adds a handler for the QueryCursor attached event.

Capture(IInputElement) Capture(IInputElement) Capture(IInputElement) Capture(IInputElement)

Captura la entrada del mouse en el elemento especificado.Captures mouse input to the specified element.

Capture(IInputElement, CaptureMode) Capture(IInputElement, CaptureMode) Capture(IInputElement, CaptureMode) Capture(IInputElement, CaptureMode)

Captura la entrada del mouse en el elemento especificado utilizando el objeto CaptureMode especificado.Captures mouse input to the specified element using the specified CaptureMode.

GetIntermediatePoints(IInputElement, Point[]) GetIntermediatePoints(IInputElement, Point[]) GetIntermediatePoints(IInputElement, Point[]) GetIntermediatePoints(IInputElement, Point[])

Recupera hasta 64 coordenadas anteriores del puntero del mouse desde el último evento de movimiento del mouse.Retrieves up to 64 previous coordinates of the mouse pointer since the last mouse move event.

GetPosition(IInputElement) GetPosition(IInputElement) GetPosition(IInputElement) GetPosition(IInputElement)

Obtiene la posición del mouse respecto a un elemento especificado.Gets the position of the mouse relative to a specified element.

RemoveGotMouseCaptureHandler(DependencyObject, MouseEventHandler) RemoveGotMouseCaptureHandler(DependencyObject, MouseEventHandler) RemoveGotMouseCaptureHandler(DependencyObject, MouseEventHandler) RemoveGotMouseCaptureHandler(DependencyObject, MouseEventHandler)

Quita un controlador del evento adjunto GotMouseCapture .Removes a handler for the GotMouseCapture attached event.

RemoveLostMouseCaptureHandler(DependencyObject, MouseEventHandler) RemoveLostMouseCaptureHandler(DependencyObject, MouseEventHandler) RemoveLostMouseCaptureHandler(DependencyObject, MouseEventHandler) RemoveLostMouseCaptureHandler(DependencyObject, MouseEventHandler)

Quita un controlador del evento adjunto LostMouseCapture .Removes a handler for the LostMouseCapture attached event.

RemoveMouseDownHandler(DependencyObject, MouseButtonEventHandler) RemoveMouseDownHandler(DependencyObject, MouseButtonEventHandler) RemoveMouseDownHandler(DependencyObject, MouseButtonEventHandler) RemoveMouseDownHandler(DependencyObject, MouseButtonEventHandler)

Quita un controlador del evento adjunto MouseDown .Removes a handler for the MouseDown attached event.

RemoveMouseEnterHandler(DependencyObject, MouseEventHandler) RemoveMouseEnterHandler(DependencyObject, MouseEventHandler) RemoveMouseEnterHandler(DependencyObject, MouseEventHandler) RemoveMouseEnterHandler(DependencyObject, MouseEventHandler)

Quita un controlador del evento adjunto MouseEnter .Removes a handler for the MouseEnter attached event.

RemoveMouseLeaveHandler(DependencyObject, MouseEventHandler) RemoveMouseLeaveHandler(DependencyObject, MouseEventHandler) RemoveMouseLeaveHandler(DependencyObject, MouseEventHandler) RemoveMouseLeaveHandler(DependencyObject, MouseEventHandler)

Quita un controlador del evento adjunto MouseLeave .Removes a handler for the MouseLeave attached event.

RemoveMouseMoveHandler(DependencyObject, MouseEventHandler) RemoveMouseMoveHandler(DependencyObject, MouseEventHandler) RemoveMouseMoveHandler(DependencyObject, MouseEventHandler) RemoveMouseMoveHandler(DependencyObject, MouseEventHandler)

Quita un controlador del evento adjunto MouseMove .Removes a handler for the MouseMove attached event.

RemoveMouseUpHandler(DependencyObject, MouseButtonEventHandler) RemoveMouseUpHandler(DependencyObject, MouseButtonEventHandler) RemoveMouseUpHandler(DependencyObject, MouseButtonEventHandler) RemoveMouseUpHandler(DependencyObject, MouseButtonEventHandler)

Quita un controlador del evento adjunto MouseUp .Removes a handler for the MouseUp attached event.

RemoveMouseWheelHandler(DependencyObject, MouseWheelEventHandler) RemoveMouseWheelHandler(DependencyObject, MouseWheelEventHandler) RemoveMouseWheelHandler(DependencyObject, MouseWheelEventHandler) RemoveMouseWheelHandler(DependencyObject, MouseWheelEventHandler)

Quita un controlador del evento adjunto MouseWheel .Removes a handler for the MouseWheel attached event.

RemovePreviewMouseDownHandler(DependencyObject, MouseButtonEventHandler) RemovePreviewMouseDownHandler(DependencyObject, MouseButtonEventHandler) RemovePreviewMouseDownHandler(DependencyObject, MouseButtonEventHandler) RemovePreviewMouseDownHandler(DependencyObject, MouseButtonEventHandler)

Quita un controlador del evento adjunto PreviewMouseDown .Removes a handler for the PreviewMouseDown attached event.

RemovePreviewMouseDownOutsideCapturedElementHandler(DependencyObject, MouseButtonEventHandler) RemovePreviewMouseDownOutsideCapturedElementHandler(DependencyObject, MouseButtonEventHandler) RemovePreviewMouseDownOutsideCapturedElementHandler(DependencyObject, MouseButtonEventHandler) RemovePreviewMouseDownOutsideCapturedElementHandler(DependencyObject, MouseButtonEventHandler)

Quita un controlador del evento adjunto PreviewMouseDownOutsideCapturedElement .Removes a handler for the PreviewMouseDownOutsideCapturedElement attached event.

RemovePreviewMouseMoveHandler(DependencyObject, MouseEventHandler) RemovePreviewMouseMoveHandler(DependencyObject, MouseEventHandler) RemovePreviewMouseMoveHandler(DependencyObject, MouseEventHandler) RemovePreviewMouseMoveHandler(DependencyObject, MouseEventHandler)

Quita un controlador del evento adjunto PreviewMouseMove .Removes a handler for the PreviewMouseMove attached event.

RemovePreviewMouseUpHandler(DependencyObject, MouseButtonEventHandler) RemovePreviewMouseUpHandler(DependencyObject, MouseButtonEventHandler) RemovePreviewMouseUpHandler(DependencyObject, MouseButtonEventHandler) RemovePreviewMouseUpHandler(DependencyObject, MouseButtonEventHandler)

Quita un controlador del evento adjunto PreviewMouseUp .Removes a handler for the PreviewMouseUp attached event.

RemovePreviewMouseUpOutsideCapturedElementHandler(DependencyObject, MouseButtonEventHandler) RemovePreviewMouseUpOutsideCapturedElementHandler(DependencyObject, MouseButtonEventHandler) RemovePreviewMouseUpOutsideCapturedElementHandler(DependencyObject, MouseButtonEventHandler) RemovePreviewMouseUpOutsideCapturedElementHandler(DependencyObject, MouseButtonEventHandler)

Quita un controlador del evento adjunto PreviewMouseUpOutsideCapturedElement .Removes a handler for the PreviewMouseUpOutsideCapturedElement attached event.

RemovePreviewMouseWheelHandler(DependencyObject, MouseWheelEventHandler) RemovePreviewMouseWheelHandler(DependencyObject, MouseWheelEventHandler) RemovePreviewMouseWheelHandler(DependencyObject, MouseWheelEventHandler) RemovePreviewMouseWheelHandler(DependencyObject, MouseWheelEventHandler)

Quita un controlador del evento adjunto PreviewMouseWheel .Removes a handler for the PreviewMouseWheel attached event.

RemoveQueryCursorHandler(DependencyObject, QueryCursorEventHandler) RemoveQueryCursorHandler(DependencyObject, QueryCursorEventHandler) RemoveQueryCursorHandler(DependencyObject, QueryCursorEventHandler) RemoveQueryCursorHandler(DependencyObject, QueryCursorEventHandler)

Quita un controlador del evento adjunto QueryCursor.Removes a handler for the QueryCursor attached event.

SetCursor(Cursor) SetCursor(Cursor) SetCursor(Cursor) SetCursor(Cursor)

Establece el puntero del mouse en la instancia de Cursor especificada.Sets the mouse pointer to the specified Cursor.

Synchronize() Synchronize() Synchronize() Synchronize()

Exige que el mouse vuelva a sincronizarse.Forces the mouse to resynchronize.

UpdateCursor() UpdateCursor() UpdateCursor() UpdateCursor()

Exige que el cursor del mouse se actualice.Forces the mouse cursor to be updated.

Eventos adjuntos

GotMouseCapture GotMouseCapture GotMouseCapture GotMouseCapture

Se produce cuando un elemento captura el mouse.Occurs when an element captures the mouse.

LostMouseCapture LostMouseCapture LostMouseCapture LostMouseCapture

Se produce cuando un elemento pierde la captura del mouse.Occurs when an element loses mouse capture.

MouseDown MouseDown MouseDown MouseDown

Se produce cuando se presiona cualquier botón del mouse.Occurs when any mouse button is depressed.

MouseEnter MouseEnter MouseEnter MouseEnter

Se produce cuando el puntero del mouse entra en los límites de un elemento.Occurs when the mouse pointer enters the boundaries of an element.

MouseLeave MouseLeave MouseLeave MouseLeave

Se produce cuando el puntero del mouse sale de los límites de un elemento.Occurs when the mouse pointer leaves the boundaries of an element.

MouseMove MouseMove MouseMove MouseMove

Se produce cuando el puntero del mouse se mueve.Occurs when the mouse pointer moves.

MouseUp MouseUp MouseUp MouseUp

Se produce cuando se suelta cualquier botón del mouse.Occurs when any mouse button is released.

MouseWheel MouseWheel MouseWheel MouseWheel

Se produce cuando se gira la rueda del mouse.Occurs when the mouse wheel is rotated.

PreviewMouseDown PreviewMouseDown PreviewMouseDown PreviewMouseDown

Se produce cuando se presiona cualquier botón del mouse.Occurs when any mouse button is depressed.

PreviewMouseDownOutsideCapturedElement PreviewMouseDownOutsideCapturedElement PreviewMouseDownOutsideCapturedElement PreviewMouseDownOutsideCapturedElement

Se produce cuando se presiona el botón primario del mouse fuera del elemento que está capturando los eventos del mouse.Occurs when the primary mouse button is pressed outside the element that is capturing mouse events.

PreviewMouseMove PreviewMouseMove PreviewMouseMove PreviewMouseMove

Se produce cuando el mouse se mueve sobre un elemento.Occurs when the mouse moves over an element.

PreviewMouseUp PreviewMouseUp PreviewMouseUp PreviewMouseUp

Se produce cuando se suelta cualquier botón del mouse.Occurs when any mouse button is released.

PreviewMouseUpOutsideCapturedElement PreviewMouseUpOutsideCapturedElement PreviewMouseUpOutsideCapturedElement PreviewMouseUpOutsideCapturedElement

Se produce cuando se libera el botón primario del mouse fuera del elemento que está capturando los eventos del mouse.Occurs when the primary mouse button is released outside the element that is capturing mouse events.

PreviewMouseWheel PreviewMouseWheel PreviewMouseWheel PreviewMouseWheel

Se produce cuando gira la rueda del mouse.Occurs when the mouse wheel rotates.

QueryCursor QueryCursor QueryCursor QueryCursor

Se produce cuando un elemento consulta el cursor del mouse actual.Occurs when an element queries for the current mouse cursor.

Se aplica a