Stylus.Captured Property

 

Gets the element to which the stylus is bound.

Namespace:   System.Windows.Input
Assembly:  PresentationCore (in PresentationCore.dll)

public static IInputElement Captured { get; }

Property Value

Type: System.Windows.IInputElement

The IInputElement to which the stylus is bound.

The following example demonstrates how to ensure that the stylus is not captured when the user touches the stylus to the digitizer. This example assumes that the PreviewStylusDown event is connected to the event handler.

void Window1_PreviewStylusDown(object sender, StylusEventArgs e)
{
    IInputElement capturedElement = Stylus.Captured;

    if (capturedElement != null)
    {
        capturedElement.ReleaseStylusCapture();
    }
}

.NET Framework
Available since 3.0
Return to top
Show: