次の方法で共有


StylusPlugIn.OnStylusLeave(RawStylusInput, Boolean) メソッド

定義

カーソルが要素の境界内から出たときにペン スレッド上で発生します。

protected:
 virtual void OnStylusLeave(System::Windows::Input::StylusPlugIns::RawStylusInput ^ rawStylusInput, bool confirmed);
protected virtual void OnStylusLeave (System.Windows.Input.StylusPlugIns.RawStylusInput rawStylusInput, bool confirmed);
abstract member OnStylusLeave : System.Windows.Input.StylusPlugIns.RawStylusInput * bool -> unit
override this.OnStylusLeave : System.Windows.Input.StylusPlugIns.RawStylusInput * bool -> unit
Protected Overridable Sub OnStylusLeave (rawStylusInput As RawStylusInput, confirmed As Boolean)

パラメーター

rawStylusInput
RawStylusInput

ペンからの入力に関する情報を格納する RawStylusInput

confirmed
Boolean

ペンが要素の範囲から実際に出た場合は true。それ以外の場合は false

次の例では、カーソルが StylusPlugIn 要素の境界から離れたときをリセットします。

// StylusPointCollection that contains the stylus points of the current
// stroke.
StylusPointCollection points;

// Keeps track of the stylus to check whether two styluses are used on the
// digitizer.
int currentStylus;
' StylusPointCollection that contains the stylus points of the current
' stroke.
Private points As StylusPointCollection

' Keeps track of the stylus to check whether two styluses are used on the
' digitizer.
Private currentStylus As Integer
// If the element loses focus, stop collecting the points and don't
// perform gesture recognition.
protected override void OnStylusLeave(RawStylusInput rawStylusInput, bool confirmed)
{
    if (confirmed)
    {
        // Clear the StylusPointCollection
        points = null;
        currentStylus = 0;
    }
}
' If the element loses focus, stop collecting the points and don't
' perform gesture recognition.
Protected Overrides Sub OnStylusLeave(ByVal rawStylusInput As RawStylusInput, ByVal confirmed As Boolean)

    If confirmed Then
        ' Clear the StylusPointCollection
        points = Nothing
        currentStylus = 0
    End If

End Sub

注釈

このメソッドはペン スレッドで発生するため、パフォーマンスに影響を与えないように、このメソッドの作業を最小限に抑えます。

適用対象