Capture Method (IInputElement, CaptureMode)
Collapse the table of content
Expand the table of content

StylusDevice.Capture Method (IInputElement, CaptureMode)

 

Binds the stylus to the specified element.

Namespace:   System.Windows.Input
Assembly:  PresentationCore (in PresentationCore.dll)

public bool Capture(
	IInputElement element,
	CaptureMode captureMode
)

Parameters

element
Type: System.Windows.IInputElement

The element to which the stylus is bound.

captureMode
Type: System.Windows.Input.CaptureMode

One of the CaptureMode values.

Return Value

Type: System.Boolean

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

Exception Condition
ArgumentNullException

element or captureMode is null.

InvalidOperationException

element is neither UIElement or FrameworkContentElement.

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);

.NET Framework
Available since 3.0
Return to top
Show:
© 2016 Microsoft