संपादित करें

इसके माध्यम से साझा किया गया


StylusDevice.Capture Method

Definition

Binds input from the stylus to a particular element.

Overloads

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

Parameters

element
IInputElement

The element to which the stylus is bound.

Returns

true if the input element is captured successfully; otherwise, false. The default is false.

Exceptions

element is null.

Examples

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)

Applies to

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
Public Function Capture (element As IInputElement, captureMode As CaptureMode) As Boolean

Parameters

element
IInputElement

The element to which the stylus is bound.

captureMode
CaptureMode

One of the CaptureMode values.

Returns

true if the input element is captured successfully; otherwise, false. The default is false.

Exceptions

element or captureMode is null.

Examples

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)

Applies to