Stylus::Capture Method (IInputElement^, CaptureMode)
Captures the stylus to the specified element.
Assembly: PresentationCore (in PresentationCore.dll)
Parameters
- element
-
Type:
System.Windows::IInputElement^
The element to capture the stylus to.
- captureMode
-
Type:
System.Windows.Input::CaptureMode
One of the CaptureMode values.
Use the Capture(IInputElement^, CaptureMode) method to ensure that element receives stylus events even when the cursor goes out of the elements' bounds. To release the stylus, call Capture(IInputElement^, CaptureMode) with the CaptureMode set to None.
The Capture(IInputElement^, CaptureMode) method returns false if element is not visible or enabled.
The following example demonstrates how to record the coordinates of the stylus, even if the stylus leaves the bounds of a TextBox. This example assumes that there is a TextBox called textBox1, and that the StylusDown, StylusUp, and StylusMove events are connected to the event handlers.
Available since 3.0