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)
XML Namespace:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

[TypeConverterAttribute(typeof(MouseActionConverter))] 
public enum MouseAction : byte
/** @attribute TypeConverterAttribute(System.Windows.Input.MouseActionConverter) */ 
public enum MouseAction
TypeConverterAttribute(System.Windows.Input.MouseActionConverter) 
public enum MouseAction
<object property="EnumerationValue" .../>

 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" />

MouseGesture CutCmdMouseGesture = new MouseGesture(
    MouseAction.MiddleClick);

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

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

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

ADD
Show:
© 2015 Microsoft