UIElement.CaptureTouch(TouchDevice) 方法

定義

嘗試強制將觸控擷取至這個項目。

C#
public bool CaptureTouch(System.Windows.Input.TouchDevice touchDevice);

參數

touchDevice
TouchDevice

要擷取的裝置。

傳回

如果指定的觸控已擷取至這個項目,則為 true,否則為 false

例外狀況

touchDevicenull

備註

CaptureTouch如果 目前擷取到另一個專案, TouchDevice 將會傳回 false

如果 傳 CaptureTouchtrue ,則會 GotTouchCapture 引發 事件。

若要從這個專案釋放單一觸控的擷取,請使用 ReleaseTouchCapture 方法並指定要釋放的觸控裝置。 若要釋放這個專案的所有觸控,請使用 ReleaseAllTouchCaptures 方法。

適用於

產品 版本
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

另請參閱