Export (0) Print
Expand All
Expand Minimize

MouseAction Enumeration

Specifies constants that define actions performed by the mouse.

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

'Declaration
<TypeConverterAttribute(GetType(MouseActionConverter))> _
Public Enumeration MouseAction
<object property="enumerationMemberName" .../>

Member nameDescription
LeftClickA left mouse button click.
LeftDoubleClickA left mouse button double-click.
MiddleClickA middle mouse button click.
MiddleDoubleClickA middle mouse button double-click.
NoneNo action.
RightClickA right mouse button click.
RightDoubleClickA right mouse button double-click.
WheelClickA 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

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft