UIElement.CaptureTouch(TouchDevice) UIElement.CaptureTouch(TouchDevice) UIElement.CaptureTouch(TouchDevice) Method

定义

尝试将触摸屏输入强制捕获到此元素。Attempts to force capture of a touch to this element.

public:
 bool CaptureTouch(System::Windows::Input::TouchDevice ^ touchDevice);
public bool CaptureTouch (System.Windows.Input.TouchDevice touchDevice);
member this.CaptureTouch : System.Windows.Input.TouchDevice -> bool

参数

touchDevice
TouchDevice TouchDevice TouchDevice

要捕获的设备。The device to capture.

返回

如果将指定触摸屏输入捕获到此元素,则为 true ;否则为 falsetrue if the specified touch is captured to this element; otherwise, false.

异常

touchDevicenulltouchDevice is null.

注解

CaptureTouch如果当前false已捕获到另一个元素,则将返回。TouchDeviceCaptureTouch will return false if the TouchDevice is currently captured to another element.

如果CaptureTouch返回true ,GotTouchCapture则引发事件。If CaptureTouch returns true, then the GotTouchCapture event is raised.

若要从此元素中释放单个触摸的捕获, 请使用ReleaseTouchCapture方法并指定要释放的触摸设备。To release capture of a single touch from this element, use the ReleaseTouchCapture method and specify the touch device to release. 若要释放此元素的所有接触, 请ReleaseAllTouchCaptures使用方法。To release all touches from this element, use the ReleaseAllTouchCaptures method.

适用于

另请参阅