Mouse Mouse Mouse Mouse Class

Definizione

Rappresenta il dispositivo mouse per un thread specifico.Represents the mouse device to a specific thread.

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

Commenti

La Mouse classe fornisce eventi, metodi e proprietà correlati al mouse che forniscono informazioni relative allo stato del mouse.The Mouse class provides mouse related events, methods and, properties which provide information regarding the state of the mouse.

Ogni evento che Mouse definisce come un evento associato viene inoltre nuovamente esposto dalle classi UIElement degli elementi di base e ContentElement come nuovo evento indirizzato.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. In genere, è più semplice gestire gli eventi del mouse per un'applicazione UIElement in ContentElemente, anziché usare gli Mouse eventi.Generally, it is more convenient to handle mouse events for an application on UIElement and ContentElement, rather than using the Mouse events. Per informazioni dettagliate, vedere Cenni preliminari sull'input.For details, see Input Overview.

I membri statici della Mouse classe delegano al database primario MouseDevice del gestore di input del thread chiamante.The static members of the Mouse class delegate to the primary MouseDevice of the calling thread's input manager.

Campi

GotMouseCaptureEvent GotMouseCaptureEvent GotMouseCaptureEvent GotMouseCaptureEvent

Identifica l'evento associato GotMouseCapture.Identifies the GotMouseCapture attached event.

LostMouseCaptureEvent LostMouseCaptureEvent LostMouseCaptureEvent LostMouseCaptureEvent

Identifica l'evento associato LostMouseCapture.Identifies the LostMouseCapture attached event.

MouseDownEvent MouseDownEvent MouseDownEvent MouseDownEvent

Identifica l'evento associato MouseDown.Identifies the MouseDown attached event.

MouseEnterEvent MouseEnterEvent MouseEnterEvent MouseEnterEvent

Identifica l'evento associato MouseEnter.Identifies the MouseEnter attached event.

MouseLeaveEvent MouseLeaveEvent MouseLeaveEvent MouseLeaveEvent

Identifica l'evento associato MouseLeave.Identifies the MouseLeave attached event.

MouseMoveEvent MouseMoveEvent MouseMoveEvent MouseMoveEvent

Identifica l'evento associato MouseMove.Identifies the MouseMove attached event.

MouseUpEvent MouseUpEvent MouseUpEvent MouseUpEvent

Identifica l'evento associato MouseUp.Identifies the MouseUp attached event.

MouseWheelDeltaForOneLine MouseWheelDeltaForOneLine MouseWheelDeltaForOneLine MouseWheelDeltaForOneLine

Rappresenta il numero di unità per cui la rotellina del mouse viene ruotata per scorrere di una riga.Represents the number of units the mouse wheel is rotated to scroll one line.

MouseWheelEvent MouseWheelEvent MouseWheelEvent MouseWheelEvent

Identifica l'evento associato MouseWheel.Identifies the MouseWheel attached event.

PreviewMouseDownEvent PreviewMouseDownEvent PreviewMouseDownEvent PreviewMouseDownEvent

Identifica l'evento associato PreviewMouseDown.Identifies the PreviewMouseDown attached event.

PreviewMouseDownOutsideCapturedElementEvent PreviewMouseDownOutsideCapturedElementEvent PreviewMouseDownOutsideCapturedElementEvent PreviewMouseDownOutsideCapturedElementEvent

Identifica l'evento associato PreviewMouseDownOutsideCapturedElement.Identifies the PreviewMouseDownOutsideCapturedElement attached event.

PreviewMouseMoveEvent PreviewMouseMoveEvent PreviewMouseMoveEvent PreviewMouseMoveEvent

Identifica l'evento associato PreviewMouseMove.Identifies the PreviewMouseMove attached event.

PreviewMouseUpEvent PreviewMouseUpEvent PreviewMouseUpEvent PreviewMouseUpEvent

Identifica l'evento associato PreviewMouseUp.Identifies the PreviewMouseUp attached event.

PreviewMouseUpOutsideCapturedElementEvent PreviewMouseUpOutsideCapturedElementEvent PreviewMouseUpOutsideCapturedElementEvent PreviewMouseUpOutsideCapturedElementEvent

Identifica l'evento associato PreviewMouseUpOutsideCapturedElement.Identifies the PreviewMouseUpOutsideCapturedElement attached event.

PreviewMouseWheelEvent PreviewMouseWheelEvent PreviewMouseWheelEvent PreviewMouseWheelEvent

Identifica l'evento associato PreviewMouseWheel.Identifies the PreviewMouseWheel attached event.

QueryCursorEvent QueryCursorEvent QueryCursorEvent QueryCursorEvent

Identifica l'evento associato QueryCursor.Identifies the QueryCursor attached event.

Proprietà

Captured Captured Captured Captured

Ottiene l'elemento che ha acquisito il mouse.Gets the element that has captured the mouse.

DirectlyOver DirectlyOver DirectlyOver DirectlyOver

Ottiene l'elemento sul quale è posizionato direttamente il puntatore del mouse.Gets the element the mouse pointer is directly over.

LeftButton LeftButton LeftButton LeftButton

Ottiene lo stato del pulsante sinistro del mouse.Gets the state of the left button of the mouse.

MiddleButton MiddleButton MiddleButton MiddleButton

Ottiene lo stato corrente del pulsante centrale del mouse.Gets the state of the middle button of the mouse.

OverrideCursor OverrideCursor OverrideCursor OverrideCursor

Ottiene o imposta il cursore per l'intera applicazione.Gets or sets the cursor for the entire application.

PrimaryDevice PrimaryDevice PrimaryDevice PrimaryDevice

Ottiene il dispositivo mouse primario.Gets the primary mouse device.

RightButton RightButton RightButton RightButton

Ottiene lo stato del pulsante destro.Gets the state of the right button.

XButton1 XButton1 XButton1 XButton1

Ottiene lo stato del primo pulsante esteso.Gets the state of the first extended button.

XButton2 XButton2 XButton2 XButton2

Ottiene lo stato del secondo pulsante esteso.Gets the state of the second extended button.

Metodi

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

Aggiunge un gestore per l'evento associato GotMouseCapture .Adds a handler for the GotMouseCapture attached event.

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

Aggiunge un gestore per l'evento associato LostMouseCapture .Adds a handler for the LostMouseCapture attached event.

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

Aggiunge un gestore per l'evento associato MouseDown .Adds a handler for the MouseDown attached event.

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

Aggiunge un gestore per l'evento associato MouseEnter .Adds a handler for the MouseEnter attached event.

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

Aggiunge un gestore per l'evento associato MouseLeave .Adds a handler for the MouseLeave attached event.

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

Aggiunge un gestore per l'evento associato MouseMove .Adds a handler for the MouseMove attached event.

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

Aggiunge un gestore per l'evento associato MouseUp .Adds a handler for the MouseUp attached event.

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

Aggiunge un gestore per l'evento associato MouseWheel .Adds a handler for the MouseWheel attached event.

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

Aggiunge un gestore per l'evento associato PreviewMouseDown .Adds a handler for the PreviewMouseDown attached event.

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

Aggiunge un gestore per l'evento associato PreviewMouseDownOutsideCapturedElement .Adds a handler for the PreviewMouseDownOutsideCapturedElement attached event.

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

Aggiunge un gestore per l'evento associato PreviewMouseMove .Adds a handler for the PreviewMouseMove attached event.

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

Aggiunge un gestore per l'evento associato PreviewMouseUp .Adds a handler for the PreviewMouseUp attached event.

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

Aggiunge un gestore per l'evento associato PreviewMouseUpOutsideCapturedElement .Adds a handler for the PreviewMouseUpOutsideCapturedElement attached event.

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

Aggiunge un gestore per l'evento associato PreviewMouseWheel .Adds a handler for the PreviewMouseWheel attached event.

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

Aggiunge un gestore per l'evento associato QueryCursor.Adds a handler for the QueryCursor attached event.

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

Acquisisce gli input del mouse nell'elemento specificato.Captures mouse input to the specified element.

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

Acquisisce l'input del mouse per l'elemento specificato usando l'oggetto CaptureMode specificato.Captures mouse input to the specified element using the specified CaptureMode.

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

Recupera fino a 64 coordinate precedenti del puntatore del mouse fin dall'ultimo evento di spostamento 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)

Ottiene la posizione del puntatore del mouse relativa a un elemento specificato.Gets the position of the mouse relative to a specified element.

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

Rimuove un gestore per l'evento associato GotMouseCapture .Removes a handler for the GotMouseCapture attached event.

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

Rimuove un gestore per l'evento associato LostMouseCapture .Removes a handler for the LostMouseCapture attached event.

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

Rimuove un gestore per l'evento associato MouseDown .Removes a handler for the MouseDown attached event.

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

Rimuove un gestore per l'evento associato MouseEnter .Removes a handler for the MouseEnter attached event.

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

Rimuove un gestore per l'evento associato MouseLeave .Removes a handler for the MouseLeave attached event.

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

Rimuove un gestore per l'evento associato MouseMove .Removes a handler for the MouseMove attached event.

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

Rimuove un gestore per l'evento associato MouseUp .Removes a handler for the MouseUp attached event.

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

Rimuove un gestore per l'evento associato MouseWheel .Removes a handler for the MouseWheel attached event.

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

Rimuove un gestore per l'evento associato PreviewMouseDown .Removes a handler for the PreviewMouseDown attached event.

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

Rimuove un gestore per l'evento associato PreviewMouseDownOutsideCapturedElement .Removes a handler for the PreviewMouseDownOutsideCapturedElement attached event.

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

Rimuove un gestore per l'evento associato PreviewMouseMove .Removes a handler for the PreviewMouseMove attached event.

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

Rimuove un gestore per l'evento associato PreviewMouseUp .Removes a handler for the PreviewMouseUp attached event.

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

Rimuove un gestore per l'evento associato PreviewMouseUpOutsideCapturedElement .Removes a handler for the PreviewMouseUpOutsideCapturedElement attached event.

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

Rimuove un gestore per l'evento associato PreviewMouseWheel .Removes a handler for the PreviewMouseWheel attached event.

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

Rimuove un gestore per l'evento associato QueryCursor.Removes a handler for the QueryCursor attached event.

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

Imposta il puntatore del mouse in relazione all'oggetto Cursor specificato.Sets the mouse pointer to the specified Cursor.

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

Forza la risincronizzazione del mouse.Forces the mouse to resynchronize.

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

Forza l'aggiornamento del cursore del mouse.Forces the mouse cursor to be updated.

Eventi associati

GotMouseCapture GotMouseCapture GotMouseCapture GotMouseCapture

Si verifica quando un elemento acquisisce il mouse.Occurs when an element captures the mouse.

LostMouseCapture LostMouseCapture LostMouseCapture LostMouseCapture

Si verifica quando un elemento perde l’acquisizione del mouse.Occurs when an element loses mouse capture.

MouseDown MouseDown MouseDown MouseDown

Si verifica quando viene premuto un pulsante qualsiasi del mouse.Occurs when any mouse button is depressed.

MouseEnter MouseEnter MouseEnter MouseEnter

Si verifica quando il puntatore del mouse entra nei limiti di un elemento.Occurs when the mouse pointer enters the boundaries of an element.

MouseLeave MouseLeave MouseLeave MouseLeave

Si verifica quando il puntatore del mouse esce dai limiti di un elemento.Occurs when the mouse pointer leaves the boundaries of an element.

MouseMove MouseMove MouseMove MouseMove

Si verifica quando il puntatore del mouse si sposta.Occurs when the mouse pointer moves.

MouseUp MouseUp MouseUp MouseUp

Si verifica quando viene rilasciato un pulsante qualsiasi del mouse.Occurs when any mouse button is released.

MouseWheel MouseWheel MouseWheel MouseWheel

Si verifica quando la rotella del mouse viene ruotata.Occurs when the mouse wheel is rotated.

PreviewMouseDown PreviewMouseDown PreviewMouseDown PreviewMouseDown

Si verifica quando viene premuto un pulsante qualsiasi del mouse.Occurs when any mouse button is depressed.

PreviewMouseDownOutsideCapturedElement PreviewMouseDownOutsideCapturedElement PreviewMouseDownOutsideCapturedElement PreviewMouseDownOutsideCapturedElement

Si verifica quando viene premuto il pulsante principale del mouse all'esterno dell'elemento che esegue l'acquisizione degli eventi del mouse.Occurs when the primary mouse button is pressed outside the element that is capturing mouse events.

PreviewMouseMove PreviewMouseMove PreviewMouseMove PreviewMouseMove

Si verifica quando il puntatore del mouse viene posizionato su un elemento.Occurs when the mouse moves over an element.

PreviewMouseUp PreviewMouseUp PreviewMouseUp PreviewMouseUp

Si verifica quando viene rilasciato un pulsante qualsiasi del mouse.Occurs when any mouse button is released.

PreviewMouseUpOutsideCapturedElement PreviewMouseUpOutsideCapturedElement PreviewMouseUpOutsideCapturedElement PreviewMouseUpOutsideCapturedElement

Si verifica quando viene rilasciato il pulsante principale del mouse all'esterno dell'elemento che esegue l'acquisizione degli eventi del mouse.Occurs when the primary mouse button is released outside the element that is capturing mouse events.

PreviewMouseWheel PreviewMouseWheel PreviewMouseWheel PreviewMouseWheel

Si verifica quando la rotella del mouse viene ruotata.Occurs when the mouse wheel rotates.

QueryCursor QueryCursor QueryCursor QueryCursor

Si verifica quando viene eseguita la ricerca del cursore del mouse corrente in relazione a un elemento.Occurs when an element queries for the current mouse cursor.

Si applica a