StylusDevice.Capture Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
.
element
is neither UIElement or FrameworkContentElement.
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
.
element
is neither UIElement or FrameworkContentElement.
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)