Stylus.Captured 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得觸控筆綁定的元素。
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