Stylus.StylusOutOfRange 附加事件


在触笔超出绘图板范围时发生。Occurs when the stylus goes out of range of the tablet.

see AddStylusOutOfRangeHandler, and RemoveStylusOutOfRangeHandler
see AddStylusOutOfRangeHandler, and RemoveStylusOutOfRangeHandler
see AddStylusOutOfRangeHandler, and RemoveStylusOutOfRangeHandler


下面的示例演示如何在触笔超出范围时将光标更改为箭头。The following example demonstrates how to change the cursor to an arrow when the stylus goes out of range. 此示例假定存在一个名为 InkCanvasinkCanvas1 ,该事件已 StylusOutOfRange 连接到事件处理程序。This example assumes that there is an InkCanvas called inkCanvas1 and that the StylusOutOfRange event is connected to an event handler. 若要查看光标更改,请将 UseCustomCursor 属性设置为 true "开" inkCanvas1To see the cursor change, set the UseCustomCursor property to true on inkCanvas1.

void inkCanvas1_StylusOutOfRange(object sender, StylusEventArgs e)
    inkCanvas1.Cursor = System.Windows.Input.Cursors.Arrow;
Private Sub inkCanvas1_StylusOutOfRange(ByVal sender As Object, ByVal e As StylusEventArgs) _
    Handles inkCanvas1.StylusOutOfRange

    inkCanvas1.Cursor = System.Windows.Input.Cursors.Arrow

End Sub


这是一个附加事件。This is an attached event. WPF 将附加事件作为路由事件实现。WPF implements attached events as routed events. 附加事件本质上是一种 XAML 语言概念,用于引用在不具有自身定义事件的对象上处理的事件。An attached event is, fundamentally, a XAML language concept used to reference events that are handled on objects that do not, themselves, define events. WPF 进一步扩展了附加事件的功能,从而允许它遍历路由。WPF further expands an attached event's capabilities, allowing it to traverse a route. 附加事件在代码中没有直接处理语法;若要在代码中附加路由事件的处理程序,请使用指定的 Add * 处理程序方法。Attached events do not have a direct handling syntax in code; to attach handlers for a routed event in code, use a designated Add*Handler method. 有关详细信息,请参阅 附加事件概述For details, see Attached Events Overview.

路由事件信息Routed Event Information

标识符字段Identifier field StylusOutOfRangeEvent
路由策略Routing strategy 冒泡Bubbling
委托Delegate StylusEventHandler