MouseGesture.Matches(Object, InputEventArgs) メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
指定MouseGestureInputEventArgs オブジェクトに関連付けられている入力と一致するかどうかを判断します。
public:
override bool Matches(System::Object ^ targetElement, System::Windows::Input::InputEventArgs ^ inputEventArgs);
public override bool Matches(object targetElement, System.Windows.Input.InputEventArgs inputEventArgs);
override this.Matches : obj * System.Windows.Input.InputEventArgs -> bool
Public Overrides Function Matches (targetElement As Object, inputEventArgs As InputEventArgs) As Boolean
パラメーター
- targetElement
- Object
ターゲット。
- inputEventArgs
- InputEventArgs
このジェスチャと比較する入力イベント データ。
返品
true イベント データがこの MouseGestureと一致する場合は。それ以外の場合は false。
例
次の例は、 MouseGesture が InputEventArgsのインスタンスに関連付けられている入力と一致するかどうかをテストする方法を示しています。 MouseDown イベント ハンドラーは、MouseGesture メソッドを使用して、イベント データをMatchesと比較します。
private void OnMouseDown(object sender, MouseEventArgs e)
{
MouseGesture mouseGesture = new MouseGesture(MouseAction.MiddleClick,ModifierKeys.Control);
if (mouseGesture.Matches(null, e))
{
MessageBox.Show("Trapped Mouse Gesture");
}
}
Private Overloads Sub OnMouseDown(ByVal sender As Object, ByVal e As MouseEventArgs)
Dim mouseGesture As New MouseGesture(MouseAction.MiddleClick,ModifierKeys.Control)
If mouseGesture.Matches(Nothing, e) Then
MessageBox.Show("Trapped Mouse Gesture")
End If
End Sub