Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

MouseAction Enumeration

 

Specifies constants that define actions performed by the mouse.

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

<TypeConverterAttribute(GetType(MouseActionConverter))>
Public Enumeration MouseAction

Member nameDescription
LeftClick

A left mouse button click.

LeftDoubleClick

A left mouse button double-click.

MiddleClick

A middle mouse button click.

MiddleDoubleClick

A middle mouse button double-click.

None

No action.

RightClick

A right mouse button click.

RightDoubleClick

A right mouse button double-click.

WheelClick

A mouse wheel rotation.

The MouseAction enumeration specifies constants which correspond to actions performed by the mouse, such as RightClick and RightDoubleClick.

MouseAction can be used with a MouseGesture to create a input gesture which can be bound to a command using a MouseBinding. For more information about commanding, see the Commanding Overview.

The following example shows how to construct a MouseGesture using a MouseAction and how to bind the gesture to a RoutedCommand using a MouseBinding.

<MouseBinding MouseAction="MiddleClick"
              Command="ApplicationCommands.Cut" />
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)

.NET Framework
Available since 3.0
Return to top
Show:
© 2017 Microsoft