Stylus 类

定义

提供对有关触笔的一般信息的访问。Provides access to general information about a tablet pen.

public ref class Stylus abstract sealed
public static class Stylus
type Stylus = class
Public Class Stylus
继承
Stylus

示例

下面的示例演示如何记录触笔的坐标,即使触笔离开的边界也是如此 TextBoxThe following example demonstrates how to record the coordinates of the stylus, even if the stylus leaves the bounds of a TextBox. 此示例假设有一个被 TextBox 调用的 textBox1 ,并且 StylusDownStylusUpStylusMove 事件已连接到事件处理程序。This example assumes that there is a TextBox called textBox1, and that the StylusDown, StylusUp, and StylusMove events are connected to event handlers.

void textbox1_StylusDown(object sender, StylusDownEventArgs e)
{
    Stylus.Capture(textbox1);
}

void textbox1_StylusMove(object sender, StylusEventArgs e)
{
    Point pos = e.GetPosition(textbox1);
    textbox1.AppendText("X: " + pos.X + " Y: " + pos.Y + "\n");
}

void textbox1_StylusUp(object sender, StylusEventArgs e)
{
    Stylus.Capture(textbox1, CaptureMode.None);
}
Private Sub textbox1_StylusDown(ByVal sender As Object, ByVal e As System.Windows.Input.StylusDownEventArgs) _
    Handles textbox1.StylusDown

    Stylus.Capture(textbox1)

End Sub


Private Sub textbox1_StylusMove(ByVal sender As Object, ByVal e As StylusEventArgs) _
    Handles textbox1.StylusMove

    Dim pos As Point = e.GetPosition(textbox1)
    textbox1.AppendText("X: " & pos.X.ToString() & " Y: " & pos.Y.ToString() & vbLf)

End Sub


Private Sub textbox1_StylusUp(ByVal sender As Object, ByVal e As StylusEventArgs) _
    Handles textbox1.StylusUp

    Stylus.Capture(textbox1, CaptureMode.None)

End Sub

字段

GotStylusCaptureEvent

标识 GotStylusCapture 附加事件。Identifies the GotStylusCapture attached event.

IsFlicksEnabledProperty

标识 IsFlicksEnabled 附加属性。Identifies the IsFlicksEnabled attached property.

IsPressAndHoldEnabledProperty

标识 IsPressAndHoldEnabled 附加属性。Identifies the IsPressAndHoldEnabled attached property.

IsTapFeedbackEnabledProperty

标识 IsTapFeedbackEnabled 附加属性。Identifies the IsTapFeedbackEnabled attached property.

IsTouchFeedbackEnabledProperty

标识 IsTouchFeedbackEnabled 附加属性。Identifies the IsTouchFeedbackEnabled attached property.

LostStylusCaptureEvent

标识 LostStylusCapture 附加事件。Identifies the LostStylusCapture attached event.

PreviewStylusButtonDownEvent

标识 PreviewStylusButtonDown 附加事件。Identifies the PreviewStylusButtonDown attached event.

PreviewStylusButtonUpEvent

标识 PreviewStylusButtonUp 附加事件。Identifies the PreviewStylusButtonUp attached event.

PreviewStylusDownEvent

标识 PreviewStylusDown 附加事件。Identifies the PreviewStylusDown attached event.

PreviewStylusInAirMoveEvent

标识 PreviewStylusInAirMove 附加事件。Identifies the PreviewStylusInAirMove attached event.

PreviewStylusInRangeEvent

标识 PreviewStylusInRange 附加事件。Identifies the PreviewStylusInRange attached event.

PreviewStylusMoveEvent

标识 PreviewStylusMove 附加事件。Identifies the PreviewStylusMove attached event.

PreviewStylusOutOfRangeEvent

标识 PreviewStylusOutOfRange 附加事件。Identifies the PreviewStylusOutOfRange attached event.

PreviewStylusSystemGestureEvent

标识 PreviewStylusSystemGesture 附加事件。Identifies the PreviewStylusSystemGesture attached event.

PreviewStylusUpEvent

标识 PreviewStylusUp 附加事件。Identifies the PreviewStylusUp attached event.

StylusButtonDownEvent

标识 StylusButtonDown 附加事件。Identifies the StylusButtonDown attached event.

StylusButtonUpEvent

标识 StylusButtonUp 附加事件。Identifies the StylusButtonUp attached event.

StylusDownEvent

标识 StylusDown 附加事件。Identifies the StylusDown attached event.

StylusEnterEvent

标识 StylusEnter 附加事件。Identifies the StylusEnter attached event.

StylusInAirMoveEvent

标识 StylusInAirMove 附加事件。Identifies the StylusInAirMove attached event.

StylusInRangeEvent

标识 StylusInRange 附加事件。Identifies the StylusInRange attached event.

StylusLeaveEvent

标识 StylusLeave 附加事件。Identifies the StylusLeave attached event.

StylusMoveEvent

标识 StylusMove 附加事件。Identifies the StylusMove attached event.

StylusOutOfRangeEvent

标识 StylusOutOfRange 附加事件。Identifies the StylusOutOfRange attached event.

StylusSystemGestureEvent

标识 StylusSystemGesture 附加事件。Identifies the StylusSystemGesture attached event.

StylusUpEvent

标识 StylusUp 附加事件。Identifies the StylusUp attached event.

属性

Captured

获取绑定了触笔的元素。Gets the element to which the stylus is bound.

CurrentStylusDevice

获取当前正在使用的触笔。Gets the stylus that represents the stylus currently in use.

DirectlyOver

获取触笔正下方的元素。Gets the element that is directly beneath the stylus.

附加属性

IsFlicksEnabled

获取或设置一个值,该值指示是否启用了笔势。Gets or sets a value indicating whether flicks are enabled.

IsPressAndHoldEnabled

获取或设置一个值,该值指示是否启用了按住。Gets or sets a values indicating whether press and hold is enabled.

IsTapFeedbackEnabled

获取或设置一个值,该值指示是否启用了点击反馈。Gets or sets whether a value indicating whether tap feedback is enabled.

IsTouchFeedbackEnabled

获取或设置一个值,该值指示是否启用了触摸反馈。Gets or sets whether a value indicating whether touch feedback is enabled.

方法

AddGotStylusCaptureHandler(DependencyObject, StylusEventHandler)

GotStylusCapture 附加事件添加处理程序。Adds a handler for the GotStylusCapture attached event.

AddLostStylusCaptureHandler(DependencyObject, StylusEventHandler)

LostStylusCapture 附加事件添加处理程序。Adds a handler for the LostStylusCapture attached event.

AddPreviewStylusButtonDownHandler(DependencyObject, StylusButtonEventHandler)

PreviewStylusButtonDown 附加事件添加处理程序。Adds a handler for the PreviewStylusButtonDown attached event.

AddPreviewStylusButtonUpHandler(DependencyObject, StylusButtonEventHandler)

PreviewStylusButtonUp 附加事件添加处理程序。Adds a handler for the PreviewStylusButtonUp attached event.

AddPreviewStylusDownHandler(DependencyObject, StylusDownEventHandler)

PreviewStylusDown 附加事件添加处理程序。Adds a handler for the PreviewStylusDown attached event.

AddPreviewStylusInAirMoveHandler(DependencyObject, StylusEventHandler)

PreviewStylusInAirMove 附加事件添加处理程序。Adds a handler for the PreviewStylusInAirMove attached event.

AddPreviewStylusInRangeHandler(DependencyObject, StylusEventHandler)

PreviewStylusInRange 附加事件添加处理程序。Adds a handler for the PreviewStylusInRange attached event.

AddPreviewStylusMoveHandler(DependencyObject, StylusEventHandler)

PreviewStylusMove 附加事件添加处理程序。Adds a handler for the PreviewStylusMove attached event.

AddPreviewStylusOutOfRangeHandler(DependencyObject, StylusEventHandler)

PreviewStylusOutOfRange 附加事件添加处理程序。Adds a handler for the PreviewStylusOutOfRange attached event.

AddPreviewStylusSystemGestureHandler(DependencyObject, StylusSystemGestureEventHandler)

PreviewStylusSystemGesture 附加事件添加处理程序。Adds a handler for the PreviewStylusSystemGesture attached event.

AddPreviewStylusUpHandler(DependencyObject, StylusEventHandler)

PreviewStylusUp 附加事件添加处理程序。Adds a handler for the PreviewStylusUp attached event.

AddStylusButtonDownHandler(DependencyObject, StylusButtonEventHandler)

StylusButtonDown 附加事件添加处理程序。Adds a handler for the StylusButtonDown attached event.

AddStylusButtonUpHandler(DependencyObject, StylusButtonEventHandler)

StylusButtonUp 附加事件添加处理程序。Adds a handler for the StylusButtonUp attached event.

AddStylusDownHandler(DependencyObject, StylusDownEventHandler)

StylusDown 附加事件添加处理程序。Adds a handler for the StylusDown attached event.

AddStylusEnterHandler(DependencyObject, StylusEventHandler)

StylusEnter 附加事件添加处理程序。Adds a handler for the StylusEnter attached event.

AddStylusInAirMoveHandler(DependencyObject, StylusEventHandler)

StylusInAirMove 附加事件添加处理程序。Adds a handler for the StylusInAirMove attached event.

AddStylusInRangeHandler(DependencyObject, StylusEventHandler)

StylusInRange 附加事件添加处理程序。Adds a handler for the StylusInRange attached event.

AddStylusLeaveHandler(DependencyObject, StylusEventHandler)

StylusLeave 附加事件添加处理程序。Adds a handler for the StylusLeave attached event.

AddStylusMoveHandler(DependencyObject, StylusEventHandler)

StylusMove 附加事件添加处理程序。Adds a handler for the StylusMove attached event.

AddStylusOutOfRangeHandler(DependencyObject, StylusEventHandler)

StylusOutOfRange 附加事件添加处理程序。Adds a handler for the StylusOutOfRange attached event.

AddStylusSystemGestureHandler(DependencyObject, StylusSystemGestureEventHandler)

StylusSystemGesture 附加事件添加处理程序。Adds a handler for the StylusSystemGesture attached event.

AddStylusUpHandler(DependencyObject, StylusEventHandler)

StylusUp 附加事件添加处理程序。Adds a handler for the StylusUp attached event.

Capture(IInputElement)

捕获指定元素的触笔。Captures the stylus to the specified element.

Capture(IInputElement, CaptureMode)

捕获指定元素的触笔。Captures the stylus to the specified element.

GetIsFlicksEnabled(DependencyObject)

获取指定元素上 IsFlicksEnabled 附加属性的值。Gets the value of the IsFlicksEnabled attached property on the specified element.

GetIsPressAndHoldEnabled(DependencyObject)

获取指定元素上 IsPressAndHoldEnabled 附加属性的值。Gets the value of the IsPressAndHoldEnabled attached property on the specified element.

GetIsTapFeedbackEnabled(DependencyObject)

获取指定元素上 IsTapFeedbackEnabled 附加属性的值。Gets the value of the IsTapFeedbackEnabled attached property on the specified element.

GetIsTouchFeedbackEnabled(DependencyObject)

获取指定元素上 IsTouchFeedbackEnabled 附加属性的值。Gets the value of the IsTouchFeedbackEnabled attached property on the specified element.

RemoveGotStylusCaptureHandler(DependencyObject, StylusEventHandler)

移除 GotStylusCapture 附加事件的处理程序。Removes a handler for the GotStylusCapture attached event.

RemoveLostStylusCaptureHandler(DependencyObject, StylusEventHandler)

移除 LostStylusCapture 附加事件的处理程序。Removes a handler for the LostStylusCapture attached event.

RemovePreviewStylusButtonDownHandler(DependencyObject, StylusButtonEventHandler)

移除 PreviewStylusButtonDown 附加事件的处理程序。Removes a handler for the PreviewStylusButtonDown attached event.

RemovePreviewStylusButtonUpHandler(DependencyObject, StylusButtonEventHandler)

移除 PreviewStylusButtonUp 附加事件的处理程序。Removes a handler for the PreviewStylusButtonUp attached event.

RemovePreviewStylusDownHandler(DependencyObject, StylusDownEventHandler)

移除 PreviewStylusDown 附加事件的处理程序。Removes a handler for the PreviewStylusDown attached event.

RemovePreviewStylusInAirMoveHandler(DependencyObject, StylusEventHandler)

移除 PreviewStylusInAirMove 附加事件的处理程序。Removes a handler for the PreviewStylusInAirMove attached event.

RemovePreviewStylusInRangeHandler(DependencyObject, StylusEventHandler)

移除 PreviewStylusInRange 附加事件的处理程序。Removes a handler for the PreviewStylusInRange attached event.

RemovePreviewStylusMoveHandler(DependencyObject, StylusEventHandler)

移除 PreviewStylusMove 附加事件的处理程序。Removes a handler for the PreviewStylusMove attached event.

RemovePreviewStylusOutOfRangeHandler(DependencyObject, StylusEventHandler)

移除 PreviewStylusOutOfRange 附加事件的处理程序。Removes a handler for the PreviewStylusOutOfRange attached event.

RemovePreviewStylusSystemGestureHandler(DependencyObject, StylusSystemGestureEventHandler)

移除 PreviewStylusSystemGesture 附加事件的处理程序。Removes a handler for the PreviewStylusSystemGesture attached event.

RemovePreviewStylusUpHandler(DependencyObject, StylusEventHandler)

移除 PreviewStylusUp 附加事件的处理程序。Removes a handler for the PreviewStylusUp attached event.

RemoveStylusButtonDownHandler(DependencyObject, StylusButtonEventHandler)

移除 StylusButtonDown 附加事件的处理程序。Removes a handler for the StylusButtonDown attached event.

RemoveStylusButtonUpHandler(DependencyObject, StylusButtonEventHandler)

移除 StylusButtonUp 附加事件的处理程序。Removes a handler for the StylusButtonUp attached event.

RemoveStylusDownHandler(DependencyObject, StylusDownEventHandler)

移除 StylusDown 附加事件的处理程序。Removes a handler for the StylusDown attached event.

RemoveStylusEnterHandler(DependencyObject, StylusEventHandler)

移除 StylusEnter 附加事件的处理程序。Removes a handler for the StylusEnter attached event.

RemoveStylusInAirMoveHandler(DependencyObject, StylusEventHandler)

移除 StylusInAirMove 附加事件的处理程序。Removes a handler for the StylusInAirMove attached event.

RemoveStylusInRangeHandler(DependencyObject, StylusEventHandler)

移除 StylusInRange 附加事件的处理程序。Removes a handler for the StylusInRange attached event.

RemoveStylusLeaveHandler(DependencyObject, StylusEventHandler)

移除 StylusLeave 附加事件的处理程序。Removes a handler for the StylusLeave attached event.

RemoveStylusMoveHandler(DependencyObject, StylusEventHandler)

移除 StylusMove 附加事件的处理程序。Removes a handler for the StylusMove attached event.

RemoveStylusOutOfRangeHandler(DependencyObject, StylusEventHandler)

移除 StylusOutOfRange 附加事件的处理程序。Removes a handler for the StylusOutOfRange attached event.

RemoveStylusSystemGestureHandler(DependencyObject, StylusSystemGestureEventHandler)

移除 StylusSystemGesture 附加事件的处理程序。Removes a handler for the StylusSystemGesture attached event.

RemoveStylusUpHandler(DependencyObject, StylusEventHandler)

移除 StylusUp 附加事件的处理程序。Removes a handler for the StylusUp attached event.

SetIsFlicksEnabled(DependencyObject, Boolean)

获取指定元素上 IsFlicksEnabled 附加属性的值。Gets the value of the IsFlicksEnabled attached property on the specified element.

SetIsPressAndHoldEnabled(DependencyObject, Boolean)

设置指定元素上的 IsPressAndHoldEnabled 附加属性的值。Sets the value of the IsPressAndHoldEnabled attached property on the specified element.

SetIsTapFeedbackEnabled(DependencyObject, Boolean)

设置指定元素上的 IsTapFeedbackEnabled 附加属性的值。Sets the value of the IsTapFeedbackEnabled attached property on the specified element.

SetIsTouchFeedbackEnabled(DependencyObject, Boolean)

设置指定元素上的 IsTouchFeedbackEnabled 附加属性的值。Sets the value of the IsTouchFeedbackEnabled attached property on the specified element.

Synchronize()

同步光标和用户界面。Synchronizes the cursor and the user interface.

附加事件

GotStylusCapture

在元素捕获到触笔事件时发生。Occurs when an element captures the stylus events.

LostStylusCapture

在元素释放触笔事件时发生。Occurs when an element releases stylus events.

PreviewStylusButtonDown

在用户按下触笔上的其中一个按钮时发生。Occurs when the user presses one of the buttons on the stylus.

PreviewStylusButtonUp

在用户松开触笔上的其中一个按钮时发生。Occurs when the user releases one of the buttons on the stylus.

PreviewStylusDown

在用户将触笔的笔尖与手写板接触时发生。Occurs when user touches the tip of the stylus to the tablet.

PreviewStylusInAirMove

当触笔在平板电脑范围内(但未接触)移动时发生。Occurs if the stylus moves while it is within range of (but not touching) the tablet.

PreviewStylusInRange

在触笔进入绘图板范围时发生。Occurs when the stylus comes within range of the tablet.

PreviewStylusMove

触笔接触平板电脑并移动时发生。Occurs when the stylus moves while it is touching the tablet.

PreviewStylusOutOfRange

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

PreviewStylusSystemGesture

在用户使用此触笔生成系统笔势时发生。Occurs when the user makes a system gesture with this stylus.

PreviewStylusUp

当用户将触笔从平板电脑上提起时发生。Occurs when the user lifts the stylus from the tablet.

StylusButtonDown

在用户按下触笔上的其中一个按钮时发生。Occurs when the user presses one of the buttons on the stylus.

StylusButtonUp

在用户松开触笔上的其中一个按钮时发生。Occurs when the user releases one of the buttons on the stylus.

StylusDown

在用户将触笔的笔尖与手写板接触时发生。Occurs when the user touches the tip of the stylus to the tablet.

StylusEnter

触笔光标进入元素的边界时发生。Occurs when the stylus cursor enters the bounds of an element.

StylusInAirMove

当触笔在平板电脑范围内移动但不接触平板电脑时发生。Occurs when the stylus moves while it is in range of, but not touching, the tablet.

StylusInRange

在触笔进入绘图板范围时发生。Occurs when the stylus comes within range of the tablet.

StylusLeave

在触笔光标离开元素边界时发生。Occurs when the stylus cursor leaves the bounds of an element.

StylusMove

触笔接触平板电脑并移动时发生。Occurs when the stylus moves while it is touching the tablet.

StylusOutOfRange

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

StylusSystemGesture

在用户使用此触笔生成系统笔势时发生。Occurs when the user makes a system gesture with this stylus.

StylusUp

当用户将触笔从平板电脑处抬起时发生。Occurs when the user raises the stylus from the Tablet PC.

适用于