Stylus.Captured Propiedad

Definición

Obtiene el elemento al que está enlazado el lápiz óptico.

public:
 static property System::Windows::IInputElement ^ Captured { System::Windows::IInputElement ^ get(); };
public static System.Windows.IInputElement Captured { get; }
static member Captured : System.Windows.IInputElement
Public Shared ReadOnly Property Captured As IInputElement

Valor de propiedad

IInputElement al que está enlazado el lápiz óptico.

Ejemplos

En el ejemplo siguiente se muestra cómo asegurarse de que el lápiz óptico no se captura cuando el usuario toca el lápiz óptico al digitalizador. En este ejemplo se supone que el PreviewStylusDown evento está conectado al controlador de eventos.

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

    if (capturedElement != null)
    {
        capturedElement.ReleaseStylusCapture();
    }
}
Private Sub Window1_PreviewStylusDown(ByVal sender As Object, ByVal e As StylusDownEventArgs) _
    Handles Me.PreviewStylusDown

    Dim capturedElement As IInputElement = Stylus.Captured

    If Not (capturedElement Is Nothing) Then
        capturedElement.ReleaseStylusCapture()
    End If

End Sub

Se aplica a