StylusPlugIn.OnStylusLeave(RawStylusInput, Boolean) Méthode

Définition

Se produit sur un thread de stylet lorsque le curseur quitte les limites d’un élément.

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)

Paramètres

rawStylusInput
RawStylusInput

Qui RawStylusInput contient des informations sur l’entrée à partir du stylet.

confirmed
Boolean

true si le stylet a réellement laissé les limites de l’élément ; sinon, false.

Exemples

L’exemple suivant réinitialise le StylusPlugIn moment où le curseur quitte les limites de l’élément.

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

Remarques

Cette méthode se produit sur un thread de stylet, donc réduisez le travail dans cette méthode pour éviter d’affecter les performances.

S’applique à