Occurs on a pen thread when the cursor leaves the bounds of an element.
Espace de noms: System.Windows.Input.StylusPlugIns
Assembly : PresentationCore (dans presentationcore.dll)
Visual Basic (Déclaration)
Protected Overridable Sub OnStylusLeave ( _
rawStylusInput As RawStylusInput, _
confirmed As Boolean _
)
Visual Basic (Utilisation)
Dim rawStylusInput As RawStylusInput
Dim confirmed As Boolean
Me.OnStylusLeave(rawStylusInput, confirmed)
protected virtual void OnStylusLeave (
RawStylusInput rawStylusInput,
bool confirmed
)
protected:
virtual void OnStylusLeave (
RawStylusInput^ rawStylusInput,
bool confirmed
)
protected void OnStylusLeave (
RawStylusInput rawStylusInput,
boolean confirmed
)
protected function OnStylusLeave (
rawStylusInput : RawStylusInput,
confirmed : boolean
)
Vous ne pouvez pas utiliser des méthodes dans XAML.
Paramètres
- rawStylusInput
A RawStylusInput that contains information about input from the pen.
- confirmed
true if the pen actually left the bounds of the element; otherwise, false.
This method occurs on a pen thread, so minimize work in this method to avoid impacting performance.
The following example resets the StylusPlugIn when the cursor leaves the bounds of the element.
' 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
<span space="preserve">...
</span> ' 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 'OnStylusLeave
// 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;
<span space="preserve">...
</span> // 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;
}
}
Microsoft .NET Framework 3.0 est pris en charge sur Windows Vista, Microsoft Windows XP SP2 et Windows Server 2003 SP1.
.NET Framework
Prise en charge dans : 3.0