Stylus.Capture Method (IInputElement)
.NET Framework (current version)
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.
Use the Capture(IInputElement) 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) 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 there is a TextBox called textBox1, and that the StylusDown, StylusUp, and StylusMove events are connected to event handlers.
.NET Framework
Available since 3.0
Available since 3.0
Show: