StylusDevice.Capture 方法

定義

將手寫筆輸入繫結至特定項目。Binds input from the stylus to a particular element.

多載

Capture(IInputElement)

將手寫筆輸入繫結至指定的項目。Binds input from the stylus to the specified element.

Capture(IInputElement, CaptureMode)

將手寫筆繫結至指定的項目。Binds the stylus to the specified element.

Capture(IInputElement)

將手寫筆輸入繫結至指定的項目。Binds input from the stylus to the specified element.

public:
 bool Capture(System::Windows::IInputElement ^ element);
public bool Capture (System.Windows.IInputElement element);
member this.Capture : System.Windows.IInputElement -> bool
Public Function Capture (element As IInputElement) As Boolean

參數

element
IInputElement

手寫筆繫結的項目。The element to which the stylus is bound.

傳回

如果成功擷取到輸入項目,則為 true,否則為 falsetrue if the input element is captured successfully; otherwise, false. 預設為 falseThe default is false.

例外狀況

elementnullelement is null.

範例

下列範例示範Capture(IInputElement)方法。The following example demonstrates the Capture(IInputElement) method.

// Bind stylus to tablet's input element
myStylusDevice.Capture(myStylusDevice.Target);
' Bind stylus to tablet's input element
myStylusDevice.Capture(myStylusDevice.Target)

Capture(IInputElement, CaptureMode)

將手寫筆繫結至指定的項目。Binds the stylus to the specified element.

public:
 bool Capture(System::Windows::IInputElement ^ element, System::Windows::Input::CaptureMode captureMode);
public bool Capture (System.Windows.IInputElement element, System.Windows.Input.CaptureMode captureMode);
member this.Capture : System.Windows.IInputElement * System.Windows.Input.CaptureMode -> bool

參數

element
IInputElement

手寫筆繫結的項目。The element to which the stylus is bound.

captureMode
CaptureMode

其中一個 CaptureMode 值。One of the CaptureMode values.

傳回

如果成功擷取到輸入項目,則為 true,否則為 falsetrue if the input element is captured successfully; otherwise, false. 預設為 falseThe default is false.

例外狀況

elementcaptureModenullelement or captureMode is null.

範例

下列範例示範Capture(IInputElement, CaptureMode)方法。The following example demonstrates the Capture(IInputElement, CaptureMode) method.

// Bind stylus to tablet's input element
// through entire subtree
myStylusDevice.Capture(myStylusDevice.Target, CaptureMode.SubTree);
' Bind stylus to tablet's input element
' through entire subtree
myStylusDevice.Capture(myStylusDevice.Target, CaptureMode.SubTree)

適用於