Stylus 類別

定義

提供關於平板電腦的一般資訊。

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

範例

以下範例示範如何記錄唱針的座標,即使唱針離開 的 TextBox範圍。 此範例假設存在被呼叫的 TextBox ,且 、 textBox1StylusDownStylusUp事件與事件處理程序相StylusMove連。

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

欄位

名稱 Description
GotStylusCaptureEvent

識別 GotStylusCapture 所附事件。

IsFlicksEnabledProperty

IsFlicksEnabled識別所附財產。

IsPressAndHoldEnabledProperty

IsPressAndHoldEnabled識別所附財產。

IsTapFeedbackEnabledProperty

IsTapFeedbackEnabled識別所附財產。

IsTouchFeedbackEnabledProperty

IsTouchFeedbackEnabled識別所附財產。

LostStylusCaptureEvent

識別 LostStylusCapture 所附事件。

PreviewStylusButtonDownEvent

識別 PreviewStylusButtonDown 所附事件。

PreviewStylusButtonUpEvent

識別 PreviewStylusButtonUp 所附事件。

PreviewStylusDownEvent

識別 PreviewStylusDown 所附事件。

PreviewStylusInAirMoveEvent

識別 PreviewStylusInAirMove 所附事件。

PreviewStylusInRangeEvent

識別 PreviewStylusInRange 所附事件。

PreviewStylusMoveEvent

識別 PreviewStylusMove 所附事件。

PreviewStylusOutOfRangeEvent

識別 PreviewStylusOutOfRange 所附事件。

PreviewStylusSystemGestureEvent

識別 PreviewStylusSystemGesture 所附事件。

PreviewStylusUpEvent

識別 PreviewStylusUp 所附事件。

StylusButtonDownEvent

識別 StylusButtonDown 所附事件。

StylusButtonUpEvent

識別 StylusButtonUp 所附事件。

StylusDownEvent

識別 StylusDown 所附事件。

StylusEnterEvent

識別 StylusEnter 所附事件。

StylusInAirMoveEvent

識別 StylusInAirMove 所附事件。

StylusInRangeEvent

識別 StylusInRange 所附事件。

StylusLeaveEvent

識別 StylusLeave 所附事件。

StylusMoveEvent

識別 StylusMove 所附事件。

StylusOutOfRangeEvent

識別 StylusOutOfRange 所附事件。

StylusSystemGestureEvent

識別 StylusSystemGesture 所附事件。

StylusUpEvent

識別 StylusUp 所附事件。

屬性

名稱 Description
Captured

取得觸控筆綁定的元素。

CurrentStylusDevice

取得代表目前使用觸控筆的觸控筆。

DirectlyOver

它會接收觸控筆正下方的元件。

附加屬性

名稱 Description
IsFlicksEnabled

取得或設定一個值,指示是否啟用了 flicks。

IsPressAndHoldEnabled

會取得或設定一個值,指示是否啟用按住。

IsTapFeedbackEnabled

會取得或設定是否啟用輕觸回饋的值。

IsTouchFeedbackEnabled

取得或設定是否啟用觸控回饋的值。

方法

名稱 Description
AddGotStylusCaptureHandler(DependencyObject, StylusEventHandler)

新增一個處理者來處理 GotStylusCapture 附加事件。

AddLostStylusCaptureHandler(DependencyObject, StylusEventHandler)

新增一個處理者來處理 LostStylusCapture 附加事件。

AddPreviewStylusButtonDownHandler(DependencyObject, StylusButtonEventHandler)

新增一個處理者來處理 PreviewStylusButtonDown 附加事件。

AddPreviewStylusButtonUpHandler(DependencyObject, StylusButtonEventHandler)

新增一個處理者來處理 PreviewStylusButtonUp 附加事件。

AddPreviewStylusDownHandler(DependencyObject, StylusDownEventHandler)

新增一個處理者來處理 PreviewStylusDown 附加事件。

AddPreviewStylusInAirMoveHandler(DependencyObject, StylusEventHandler)

新增一個處理者來處理 PreviewStylusInAirMove 附加事件。

AddPreviewStylusInRangeHandler(DependencyObject, StylusEventHandler)

新增一個處理者來處理 PreviewStylusInRange 附加事件。

AddPreviewStylusMoveHandler(DependencyObject, StylusEventHandler)

新增一個處理者來處理 PreviewStylusMove 附加事件。

AddPreviewStylusOutOfRangeHandler(DependencyObject, StylusEventHandler)

新增一個處理者來處理 PreviewStylusOutOfRange 附加事件。

AddPreviewStylusSystemGestureHandler(DependencyObject, StylusSystemGestureEventHandler)

新增一個處理者來處理 PreviewStylusSystemGesture 附加事件。

AddPreviewStylusUpHandler(DependencyObject, StylusEventHandler)

新增一個處理者來處理 PreviewStylusUp 附加事件。

AddStylusButtonDownHandler(DependencyObject, StylusButtonEventHandler)

新增一個處理者來處理 StylusButtonDown 附加事件。

AddStylusButtonUpHandler(DependencyObject, StylusButtonEventHandler)

新增一個處理者來處理 StylusButtonUp 附加事件。

AddStylusDownHandler(DependencyObject, StylusDownEventHandler)

新增一個處理者來處理 StylusDown 附加事件。

AddStylusEnterHandler(DependencyObject, StylusEventHandler)

新增一個處理者來處理 StylusEnter 附加事件。

AddStylusInAirMoveHandler(DependencyObject, StylusEventHandler)

新增一個處理者來處理 StylusInAirMove 附加事件。

AddStylusInRangeHandler(DependencyObject, StylusEventHandler)

新增一個處理者來處理 StylusInRange 附加事件。

AddStylusLeaveHandler(DependencyObject, StylusEventHandler)

新增一個處理者來處理 StylusLeave 附加事件。

AddStylusMoveHandler(DependencyObject, StylusEventHandler)

新增一個處理者來處理 StylusMove 附加事件。

AddStylusOutOfRangeHandler(DependencyObject, StylusEventHandler)

新增一個處理者來處理 StylusOutOfRange 附加事件。

AddStylusSystemGestureHandler(DependencyObject, StylusSystemGestureEventHandler)

新增一個處理者來處理 StylusSystemGesture 附加事件。

AddStylusUpHandler(DependencyObject, StylusEventHandler)

新增一個處理者來處理 StylusUp 附加事件。

Capture(IInputElement, CaptureMode)

將觸控筆擷取到指定的元素。

Capture(IInputElement)

將觸控筆擷取到指定的元素。

GetIsFlicksEnabled(DependencyObject)

取得指定元素附加屬性 IsFlicksEnabled 的值。

GetIsPressAndHoldEnabled(DependencyObject)

取得指定元素附加屬性 IsPressAndHoldEnabled 的值。

GetIsTapFeedbackEnabled(DependencyObject)

取得指定元素附加屬性 IsTapFeedbackEnabled 的值。

GetIsTouchFeedbackEnabled(DependencyObject)

取得指定元素附加屬性 IsTouchFeedbackEnabled 的值。

RemoveGotStylusCaptureHandler(DependencyObject, StylusEventHandler)

移除所附事件的 GotStylusCapture 操作者。

RemoveLostStylusCaptureHandler(DependencyObject, StylusEventHandler)

移除所附事件的 LostStylusCapture 操作者。

RemovePreviewStylusButtonDownHandler(DependencyObject, StylusButtonEventHandler)

移除所附事件的 PreviewStylusButtonDown 操作者。

RemovePreviewStylusButtonUpHandler(DependencyObject, StylusButtonEventHandler)

移除所附事件的 PreviewStylusButtonUp 操作者。

RemovePreviewStylusDownHandler(DependencyObject, StylusDownEventHandler)

移除所附事件的 PreviewStylusDown 操作者。

RemovePreviewStylusInAirMoveHandler(DependencyObject, StylusEventHandler)

移除所附事件的 PreviewStylusInAirMove 操作者。

RemovePreviewStylusInRangeHandler(DependencyObject, StylusEventHandler)

移除所附事件的 PreviewStylusInRange 操作者。

RemovePreviewStylusMoveHandler(DependencyObject, StylusEventHandler)

移除所附事件的 PreviewStylusMove 操作者。

RemovePreviewStylusOutOfRangeHandler(DependencyObject, StylusEventHandler)

移除所附事件的 PreviewStylusOutOfRange 操作者。

RemovePreviewStylusSystemGestureHandler(DependencyObject, StylusSystemGestureEventHandler)

移除所附事件的 PreviewStylusSystemGesture 操作者。

RemovePreviewStylusUpHandler(DependencyObject, StylusEventHandler)

移除所附事件的 PreviewStylusUp 操作者。

RemoveStylusButtonDownHandler(DependencyObject, StylusButtonEventHandler)

移除所附事件的 StylusButtonDown 操作者。

RemoveStylusButtonUpHandler(DependencyObject, StylusButtonEventHandler)

移除所附事件的 StylusButtonUp 操作者。

RemoveStylusDownHandler(DependencyObject, StylusDownEventHandler)

移除所附事件的 StylusDown 操作者。

RemoveStylusEnterHandler(DependencyObject, StylusEventHandler)

移除所附事件的 StylusEnter 操作者。

RemoveStylusInAirMoveHandler(DependencyObject, StylusEventHandler)

移除所附事件的 StylusInAirMove 操作者。

RemoveStylusInRangeHandler(DependencyObject, StylusEventHandler)

移除所附事件的 StylusInRange 操作者。

RemoveStylusLeaveHandler(DependencyObject, StylusEventHandler)

移除所附事件的 StylusLeave 操作者。

RemoveStylusMoveHandler(DependencyObject, StylusEventHandler)

移除所附事件的 StylusMove 操作者。

RemoveStylusOutOfRangeHandler(DependencyObject, StylusEventHandler)

移除所附事件的 StylusOutOfRange 操作者。

RemoveStylusSystemGestureHandler(DependencyObject, StylusSystemGestureEventHandler)

移除所附事件的 StylusSystemGesture 操作者。

RemoveStylusUpHandler(DependencyObject, StylusEventHandler)

移除所附事件的 StylusUp 操作者。

SetIsFlicksEnabled(DependencyObject, Boolean)

取得指定元素附加屬性 IsFlicksEnabled 的值。

SetIsPressAndHoldEnabled(DependencyObject, Boolean)

設定附加屬性在指定元素上的值 IsPressAndHoldEnabled

SetIsTapFeedbackEnabled(DependencyObject, Boolean)

設定附加屬性在指定元素上的值 IsTapFeedbackEnabled

SetIsTouchFeedbackEnabled(DependencyObject, Boolean)

設定附加屬性在指定元素上的值 IsTouchFeedbackEnabled

Synchronize()

同步游標與使用者介面。

附加事件

名稱 Description
GotStylusCapture

當元素捕捉觸控筆事件時會發生。

LostStylusCapture

當元素釋放觸控筆事件時會發生。

PreviewStylusButtonDown

當使用者按下觸控筆上的其中一個按鈕時,會發生這種情況。

PreviewStylusButtonUp

當使用者放開觸控筆上的其中一個按鈕時,會發生這種情況。

PreviewStylusDown

當使用者將觸控筆尖端觸碰繪圖板時會發生。

PreviewStylusInAirMove

當觸控筆在距離內(但未接觸)繪圖板時移動,會發生這種情況。

PreviewStylusInRange

當觸控筆進入繪圖板範圍時會發生。

PreviewStylusMove

當觸控筆在觸控板上移動時會發生。

PreviewStylusOutOfRange

當觸控筆超出繪圖板的範圍時會發生。

PreviewStylusSystemGesture

當使用者用觸控筆做系統手勢時會發生。

PreviewStylusUp

當使用者將觸控筆從繪圖板上抬起時,會發生這種情況。

StylusButtonDown

當使用者按下觸控筆上的其中一個按鈕時,會發生這種情況。

StylusButtonUp

當使用者放開觸控筆上的其中一個按鈕時,會發生這種情況。

StylusDown

當使用者將觸控筆尖端觸碰繪圖板時,會發生這種情況。

StylusEnter

當觸控筆游標進入元素的邊界時發生。

StylusInAirMove

當觸控筆在觸控筆範圍內但未接觸到平板時移動時,會發生這種情況。

StylusInRange

當觸控筆進入繪圖板範圍時會發生。

StylusLeave

當觸控筆游標離開元素的邊界時,會發生這種情況。

StylusMove

當觸控筆在觸控板上移動時會發生。

StylusOutOfRange

當觸控筆超出繪圖板的範圍時會發生。

StylusSystemGesture

當使用者用觸控筆做系統手勢時會發生。

StylusUp

當使用者從平板電腦舉起觸控筆時,會發生這種情況。

適用於