共用方式為


Stylus.Captured 屬性

定義

取得手寫筆繫結的項目。

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

屬性值

手寫筆繫結的 IInputElement

範例

下列範例示範如何在用戶觸控手寫筆到數位板時,確保不會擷取手寫筆。 此範例假設 PreviewStylusDown 事件已連線到事件處理程式。

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

適用於