Mouse Mouse Mouse Mouse Class

Définition

Représente la souris pour un thread spécifique.Represents the mouse device to a specific thread.

public ref class Mouse abstract sealed
public static class Mouse
type Mouse = class
Public Class Mouse
Héritage
MouseMouseMouseMouse

Remarques

La Mouse classe fournit des événements liés à la souris, des méthodes et des propriétés qui fournissent des informations relatives à l’état de la souris.The Mouse class provides mouse related events, methods and, properties which provide information regarding the state of the mouse.

Chaque événement qui Mouse définit comme un événement attaché est également réexposé par les classes UIElement d’élément de base ContentElement et comme nouvel événement routé.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. En règle générale, il est plus commode de gérer les événements de souris UIElement pour ContentElementune application sur et, Mouse plutôt que d’utiliser les événements.Generally, it is more convenient to handle mouse events for an application on UIElement and ContentElement, rather than using the Mouse events. Pour plus d’informations, consultez vue d’ensemblede l’entrée.For details, see Input Overview.

Les membres statiques de Mouse la classe délèguent MouseDevice au principal du gestionnaire d’entrée du thread appelant.The static members of the Mouse class delegate to the primary MouseDevice of the calling thread's input manager.

Champs

GotMouseCaptureEvent GotMouseCaptureEvent GotMouseCaptureEvent GotMouseCaptureEvent

Identifie l’événement attaché GotMouseCapture.Identifies the GotMouseCapture attached event.

LostMouseCaptureEvent LostMouseCaptureEvent LostMouseCaptureEvent LostMouseCaptureEvent

Identifie l’événement attaché LostMouseCapture.Identifies the LostMouseCapture attached event.

MouseDownEvent MouseDownEvent MouseDownEvent MouseDownEvent

Identifie l’événement attaché MouseDown.Identifies the MouseDown attached event.

MouseEnterEvent MouseEnterEvent MouseEnterEvent MouseEnterEvent

Identifie l’événement attaché MouseEnter.Identifies the MouseEnter attached event.

MouseLeaveEvent MouseLeaveEvent MouseLeaveEvent MouseLeaveEvent

Identifie l’événement attaché MouseLeave.Identifies the MouseLeave attached event.

MouseMoveEvent MouseMoveEvent MouseMoveEvent MouseMoveEvent

Identifie l’événement attaché MouseMove.Identifies the MouseMove attached event.

MouseUpEvent MouseUpEvent MouseUpEvent MouseUpEvent

Identifie l’événement attaché MouseUp.Identifies the MouseUp attached event.

MouseWheelDeltaForOneLine MouseWheelDeltaForOneLine MouseWheelDeltaForOneLine MouseWheelDeltaForOneLine

Représente le nombre d'unités de déplacement de la roulette de la souris pour faire défiler une ligne.Represents the number of units the mouse wheel is rotated to scroll one line.

MouseWheelEvent MouseWheelEvent MouseWheelEvent MouseWheelEvent

Identifie l’événement attaché MouseWheel.Identifies the MouseWheel attached event.

PreviewMouseDownEvent PreviewMouseDownEvent PreviewMouseDownEvent PreviewMouseDownEvent

Identifie l’événement attaché PreviewMouseDown.Identifies the PreviewMouseDown attached event.

PreviewMouseDownOutsideCapturedElementEvent PreviewMouseDownOutsideCapturedElementEvent PreviewMouseDownOutsideCapturedElementEvent PreviewMouseDownOutsideCapturedElementEvent

Identifie l’événement attaché PreviewMouseDownOutsideCapturedElement.Identifies the PreviewMouseDownOutsideCapturedElement attached event.

PreviewMouseMoveEvent PreviewMouseMoveEvent PreviewMouseMoveEvent PreviewMouseMoveEvent

Identifie l’événement attaché PreviewMouseMove.Identifies the PreviewMouseMove attached event.

PreviewMouseUpEvent PreviewMouseUpEvent PreviewMouseUpEvent PreviewMouseUpEvent

Identifie l’événement attaché PreviewMouseUp.Identifies the PreviewMouseUp attached event.

PreviewMouseUpOutsideCapturedElementEvent PreviewMouseUpOutsideCapturedElementEvent PreviewMouseUpOutsideCapturedElementEvent PreviewMouseUpOutsideCapturedElementEvent

Identifie l’événement attaché PreviewMouseUpOutsideCapturedElement.Identifies the PreviewMouseUpOutsideCapturedElement attached event.

PreviewMouseWheelEvent PreviewMouseWheelEvent PreviewMouseWheelEvent PreviewMouseWheelEvent

Identifie l’événement attaché PreviewMouseWheel.Identifies the PreviewMouseWheel attached event.

QueryCursorEvent QueryCursorEvent QueryCursorEvent QueryCursorEvent

Identifie l’événement attaché QueryCursor.Identifies the QueryCursor attached event.

Propriétés

Captured Captured Captured Captured

Obtient l'élément qui a capturé la souris.Gets the element that has captured the mouse.

DirectlyOver DirectlyOver DirectlyOver DirectlyOver

Obtient l'élément sur lequel se trouve le pointeur de la souris.Gets the element the mouse pointer is directly over.

LeftButton LeftButton LeftButton LeftButton

Obtient l'état du bouton gauche de la souris.Gets the state of the left button of the mouse.

MiddleButton MiddleButton MiddleButton MiddleButton

Obtient l'état du bouton central de la souris.Gets the state of the middle button of the mouse.

OverrideCursor OverrideCursor OverrideCursor OverrideCursor

Obtient ou définit le curseur pour toute l'application.Gets or sets the cursor for the entire application.

PrimaryDevice PrimaryDevice PrimaryDevice PrimaryDevice

Obtient le périphérique souris principal.Gets the primary mouse device.

RightButton RightButton RightButton RightButton

Obtient l'état du bouton droit.Gets the state of the right button.

XButton1 XButton1 XButton1 XButton1

Obtient l'état actuel du premier bouton étendu.Gets the state of the first extended button.

XButton2 XButton2 XButton2 XButton2

Obtient l'état du deuxième bouton étendu.Gets the state of the second extended button.

Méthodes

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

Ajoute un gestionnaire pour l’événement attaché GotMouseCapture .Adds a handler for the GotMouseCapture attached event.

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

Ajoute un gestionnaire pour l’événement attaché LostMouseCapture .Adds a handler for the LostMouseCapture attached event.

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

Ajoute un gestionnaire pour l’événement attaché MouseDown .Adds a handler for the MouseDown attached event.

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

Ajoute un gestionnaire pour l’événement attaché MouseEnter .Adds a handler for the MouseEnter attached event.

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

Ajoute un gestionnaire pour l’événement attaché MouseLeave .Adds a handler for the MouseLeave attached event.

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

Ajoute un gestionnaire pour l’événement attaché MouseMove .Adds a handler for the MouseMove attached event.

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

Ajoute un gestionnaire pour l’événement attaché MouseUp .Adds a handler for the MouseUp attached event.

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

Ajoute un gestionnaire pour l’événement attaché MouseWheel .Adds a handler for the MouseWheel attached event.

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

Ajoute un gestionnaire pour l’événement attaché PreviewMouseDown .Adds a handler for the PreviewMouseDown attached event.

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

Ajoute un gestionnaire pour l’événement attaché PreviewMouseDownOutsideCapturedElement .Adds a handler for the PreviewMouseDownOutsideCapturedElement attached event.

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

Ajoute un gestionnaire pour l’événement attaché PreviewMouseMove .Adds a handler for the PreviewMouseMove attached event.

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

Ajoute un gestionnaire pour l’événement attaché PreviewMouseUp .Adds a handler for the PreviewMouseUp attached event.

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

Ajoute un gestionnaire pour l’événement attaché PreviewMouseUpOutsideCapturedElement .Adds a handler for the PreviewMouseUpOutsideCapturedElement attached event.

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

Ajoute un gestionnaire pour l’événement attaché PreviewMouseWheel .Adds a handler for the PreviewMouseWheel attached event.

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

Ajoute un gestionnaire pour l'événement attaché QueryCursor.Adds a handler for the QueryCursor attached event.

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

Capture l'entrée de la souris à l'élément spécifié.Captures mouse input to the specified element.

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

Capture l'entrée de la souris à l'élément spécifié à l'aide du CaptureModespécifié.Captures mouse input to the specified element using the specified CaptureMode.

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

Récupère jusqu'à 64 coordonnées précédentes du pointeur de la souris depuis le dernier événement de déplacement de la souris.Retrieves up to 64 previous coordinates of the mouse pointer since the last mouse move event.

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

Obtient la position de la souris par rapport à un élément spécifié.Gets the position of the mouse relative to a specified element.

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

Supprime un gestionnaire pour l’événement attaché GotMouseCapture .Removes a handler for the GotMouseCapture attached event.

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

Supprime un gestionnaire pour l’événement attaché LostMouseCapture .Removes a handler for the LostMouseCapture attached event.

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

Supprime un gestionnaire pour l’événement attaché MouseDown .Removes a handler for the MouseDown attached event.

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

Supprime un gestionnaire pour l’événement attaché MouseEnter .Removes a handler for the MouseEnter attached event.

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

Supprime un gestionnaire pour l’événement attaché MouseLeave .Removes a handler for the MouseLeave attached event.

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

Supprime un gestionnaire pour l’événement attaché MouseMove .Removes a handler for the MouseMove attached event.

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

Supprime un gestionnaire pour l’événement attaché MouseUp .Removes a handler for the MouseUp attached event.

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

Supprime un gestionnaire pour l’événement attaché MouseWheel .Removes a handler for the MouseWheel attached event.

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

Supprime un gestionnaire pour l’événement attaché PreviewMouseDown .Removes a handler for the PreviewMouseDown attached event.

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

Supprime un gestionnaire pour l’événement attaché PreviewMouseDownOutsideCapturedElement .Removes a handler for the PreviewMouseDownOutsideCapturedElement attached event.

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

Supprime un gestionnaire pour l’événement attaché PreviewMouseMove .Removes a handler for the PreviewMouseMove attached event.

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

Supprime un gestionnaire pour l’événement attaché PreviewMouseUp .Removes a handler for the PreviewMouseUp attached event.

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

Supprime un gestionnaire pour l’événement attaché PreviewMouseUpOutsideCapturedElement .Removes a handler for the PreviewMouseUpOutsideCapturedElement attached event.

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

Supprime un gestionnaire pour l’événement attaché PreviewMouseWheel .Removes a handler for the PreviewMouseWheel attached event.

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

Supprime un gestionnaire pour l'événement attaché QueryCursor.Removes a handler for the QueryCursor attached event.

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

Définit le pointeur de la souris sur le Cursor spécifié.Sets the mouse pointer to the specified Cursor.

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

Force la resynchronisation de la souris.Forces the mouse to resynchronize.

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

Force le curseur de la souris à effectuer une mise à jour.Forces the mouse cursor to be updated.

Événements attachés

GotMouseCapture GotMouseCapture GotMouseCapture GotMouseCapture

Se produit lorsqu'un élément capture la souris.Occurs when an element captures the mouse.

LostMouseCapture LostMouseCapture LostMouseCapture LostMouseCapture

Se produit lorsqu'un élément perd la capture de la souris.Occurs when an element loses mouse capture.

MouseDown MouseDown MouseDown MouseDown

Se produit lorsqu'un bouton de la souris est enfoncé.Occurs when any mouse button is depressed.

MouseEnter MouseEnter MouseEnter MouseEnter

Se produit lorsque le pointeur de la souris pénètre dans les limites d'un élément.Occurs when the mouse pointer enters the boundaries of an element.

MouseLeave MouseLeave MouseLeave MouseLeave

Se produit lorsque le pointeur de la souris quitte les limites d'un élément.Occurs when the mouse pointer leaves the boundaries of an element.

MouseMove MouseMove MouseMove MouseMove

Se produit lorsque le pointeur de la souris se déplace.Occurs when the mouse pointer moves.

MouseUp MouseUp MouseUp MouseUp

Se produit lorsqu’un bouton de la souris est relâché.Occurs when any mouse button is released.

MouseWheel MouseWheel MouseWheel MouseWheel

Se produit lorsque la roulette de la souris est actionnée.Occurs when the mouse wheel is rotated.

PreviewMouseDown PreviewMouseDown PreviewMouseDown PreviewMouseDown

Se produit lorsqu'un bouton de la souris est enfoncé.Occurs when any mouse button is depressed.

PreviewMouseDownOutsideCapturedElement PreviewMouseDownOutsideCapturedElement PreviewMouseDownOutsideCapturedElement PreviewMouseDownOutsideCapturedElement

Se produit lorsque le bouton principal de la souris est enfoncé en dehors de l'élément qui capture des événements de souris.Occurs when the primary mouse button is pressed outside the element that is capturing mouse events.

PreviewMouseMove PreviewMouseMove PreviewMouseMove PreviewMouseMove

Se produit lorsque la souris se déplace sur un élément.Occurs when the mouse moves over an element.

PreviewMouseUp PreviewMouseUp PreviewMouseUp PreviewMouseUp

Se produit lorsqu’un bouton de la souris est relâché.Occurs when any mouse button is released.

PreviewMouseUpOutsideCapturedElement PreviewMouseUpOutsideCapturedElement PreviewMouseUpOutsideCapturedElement PreviewMouseUpOutsideCapturedElement

Se produit lorsque le bouton principal de la souris est relâché en dehors de l'élément qui capture des événements de souris.Occurs when the primary mouse button is released outside the element that is capturing mouse events.

PreviewMouseWheel PreviewMouseWheel PreviewMouseWheel PreviewMouseWheel

Se produit lorsque la roulette de la souris est actionnée.Occurs when the mouse wheel rotates.

QueryCursor QueryCursor QueryCursor QueryCursor

Se produit lorsqu'un élément demande le curseur actuel de la souris.Occurs when an element queries for the current mouse cursor.

S’applique à