MouseAction 列挙型

定義

マウスによって実行されるアクションを定義する定数を指定します。

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
継承
MouseAction
属性

フィールド

名前 説明
None 0

アクションなし。

LeftClick 1

マウスの左ボタンをクリックします。

RightClick 2

マウスの右ボタンをクリックします。

MiddleClick 3

マウスの中央ボタンをクリックします。

WheelClick 4

マウス ホイールの回転。

LeftDoubleClick 5

マウスの左ボタンをダブルクリックします。

RightDoubleClick 6

マウスの右ボタンをダブルクリックします。

MiddleDoubleClick 7

マウスの中央ボタンをダブルクリックします。

次の例は、MouseAction列挙値を使用してMouseGestureを構築する方法と、MouseBindingを使用してジェスチャをRoutedCommandにバインドする方法を示しています。

<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)

注釈

MouseAction列挙体は、RightClickRightDoubleClickなど、マウスによって実行されるアクションに対応する定数を指定します。

MouseActionMouseGesture と共に使用して、 MouseBindingを使用してコマンドにバインドできる入力ジェスチャを作成できます。 コマンドの詳細については、「コマンド実行の 概要」を参照してください。

適用対象

こちらもご覧ください