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. 這個範例假設有一個 InkCanvas 呼叫 inkCanvas1
,而且該 StylusOutOfRange 事件已連接到事件處理常式。This example assumes that there is an InkCanvas called inkCanvas1
and that the StylusOutOfRange event is connected to an event handler. 若要查看資料指標變更,請將 UseCustomCursor 屬性設定為 true
on inkCanvas1
。To 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. WPFWPF 將附加事件實作為路由事件。implements attached events as routed events. 附加事件基本上是一種 XAMLXAML 語言概念,用來參考在不會定義事件的物件上處理的事件。An attached event is, fundamentally, a XAMLXAML language concept used to reference events that are handled on objects that do not, themselves, define events. WPFWPF 進一步擴充附加事件的功能,讓它能夠跨越路由。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 |