StylusDevice.Capture 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
将触笔中的输入绑定到特定元素。
重载
| 名称 | 说明 |
|---|---|
| Capture(IInputElement) |
将触笔中的输入绑定到指定的元素。 |
| Capture(IInputElement, CaptureMode) |
将触笔绑定到指定的元素。 |
Capture(IInputElement)
将触笔中的输入绑定到指定的元素。
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
参数
- element
- IInputElement
触笔绑定到的元素。
返回
true 如果成功捕获输入元素,则为 ;否则,为 false. 默认值为 false。
例外
element 是 null。
element既不是,UIElement也不是 FrameworkContentElement 。
示例
以下示例演示了该方法 Capture(IInputElement) 。
// Bind stylus to tablet's input element
myStylusDevice.Capture(myStylusDevice.Target);
' Bind stylus to tablet's input element
myStylusDevice.Capture(myStylusDevice.Target)
适用于
Capture(IInputElement, CaptureMode)
将触笔绑定到指定的元素。
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
参数
- element
- IInputElement
触笔绑定到的元素。
- captureMode
- CaptureMode
其中一个 CaptureMode 值。
返回
true 如果成功捕获输入元素,则为 ;否则,为 false. 默认值为 false。
例外
element 或 captureMode 为 null.
element既不是,UIElement也不是 FrameworkContentElement 。
示例
以下示例演示了该方法 Capture(IInputElement, CaptureMode) 。
// 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)