MouseAction Enumeración

Definición

Especifica constantes que definen las acciones realizadas por el mouse.Specifies constants that define actions performed by the mouse.

public enum class MouseAction
[System.ComponentModel.TypeConverter(typeof(System.Windows.Input.MouseActionConverter))]
public enum MouseAction
[<System.ComponentModel.TypeConverter(typeof(System.Windows.Input.MouseActionConverter))>]
type MouseAction = 
Public Enum MouseAction
Herencia
MouseAction
Atributos

Campos

LeftClick 1

Clic con el botón primario del mouse.A left mouse button click.

LeftDoubleClick 5

Doble clic con el botón primario del mouse.A left mouse button double-click.

MiddleClick 3

Clic con el botón central del mouse.A middle mouse button click.

MiddleDoubleClick 7

Doble clic con el botón central del mouse.A middle mouse button double-click.

None 0

No sucede nada.No action.

RightClick 2

Clic con el botón secundario del mouse.A right mouse button click.

RightDoubleClick 6

Doble clic con el botón secundario del mouse.A right mouse button double-click.

WheelClick 4

Rotación de la rueda del mouse.A mouse wheel rotation.

Ejemplos

En el ejemplo siguiente se muestra cómo construir MouseGesture con un MouseAction valor de enumeración y cómo enlazar el gesto a un RoutedCommand mediante MouseBinding .The following example shows how to construct a MouseGesture using a MouseAction enumeration value and how to bind the gesture to a RoutedCommand using a MouseBinding.

<MouseBinding MouseAction="MiddleClick"
              Command="ApplicationCommands.Cut" />
MouseGesture CutCmdMouseGesture = new MouseGesture(
    MouseAction.MiddleClick);

MouseBinding CutMouseBinding = new MouseBinding(
    ApplicationCommands.Cut, 
    CutCmdMouseGesture);

// RootWindow is an instance of Window.
RootWindow.InputBindings.Add(CutMouseBinding);
Dim CutCmdMouseGesture As New MouseGesture(MouseAction.MiddleClick)

Dim CutMouseBinding As New MouseBinding(ApplicationCommands.Cut, CutCmdMouseGesture)

' RootWindow is an instance of Window.
RootWindow.InputBindings.Add(CutMouseBinding)

Comentarios

La MouseAction enumeración especifica las constantes que corresponden a las acciones realizadas por el mouse, como RightClick y RightDoubleClick .The MouseAction enumeration specifies constants which correspond to actions performed by the mouse, such as RightClick and RightDoubleClick.

MouseAction se puede utilizar con un MouseGesture para crear un gesto de entrada que se puede enlazar a un comando mediante MouseBinding .MouseAction can be used with a MouseGesture to create a input gesture which can be bound to a command using a MouseBinding. Para obtener más información sobre los comandos, consulte la información general sobre comandos.For more information about commanding, see the Commanding Overview.

Se aplica a

Consulte también