StylusPlugIn.OnStylusLeave(RawStylusInput, Boolean) Methode

Definition

Tritt auf einem Stiftthread auf, wenn der Cursor die Grenzen eines Elements verlässt.

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)

Parameter

rawStylusInput
RawStylusInput

A RawStylusInput that contains information about input from the pen.

confirmed
Boolean

truewenn der Stift tatsächlich die Grenzen des Elements verlassen hat; andernfalls . false

Beispiele

Im folgenden Beispiel wird das StylusPlugIn Element zurückgesetzt, wenn der Cursor die Grenzen des Elements verlässt.

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

Hinweise

Diese Methode tritt in einem Stiftthread auf. Minimieren Sie daher die Arbeit in dieser Methode, um auswirkungen auf die Leistung zu vermeiden.

Gilt für: