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如果TouchDevice目前擷取至另一個項目。CaptureTouch 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.

適用於

另請參閱