Stylus 類別
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
可用來存取 Tablet 畫筆的一般資訊。
public ref class Stylus abstract sealed
public static class Stylus
type Stylus = class
Public Class Stylus
- 繼承
-
Stylus
下列範例示範如何記錄手寫筆的座標,即使手寫筆離開 的界限 TextBox也一樣。 這個範例假設有一個 TextBox 稱為 textBox1
的 ,而且 StylusDown、 StylusUp和 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
Captured |
取得手寫筆繫結的項目。 |
Current |
取得手寫筆,表示目前使用中的手寫筆。 |
Directly |
取得在手寫筆正下方的項目。 |
Is |
取得或設定指示是否啟用筆觸的值。 |
Is |
取得或設定值,指出是否啟用「按住不放」功能。 |
Is |
取得或設定值,指出是否啟用按鍵回應。 |
Is |
取得或設定值,指出是否啟用觸控回應。 |
Got |
在項目擷取手寫筆事件時發生。 |
Lost |
項目釋放手寫筆事件時發生。 |
Preview |
使用者按下手寫筆上其中一個按鈕時發生。 |
Preview |
使用者放開手寫筆上其中一個按鈕時發生。 |
Preview |
使用者以手寫筆尖端碰觸平板電腦時發生。 |
Preview |
手寫筆在平板電腦的範圍內 (但未碰觸) 移動時發生。 |
Preview |
手寫筆進入平板電腦的範圍內時發生。 |
Preview |
手寫筆碰觸平板電腦且移動時發生。 |
Preview |
手寫筆超出平板電腦的範圍時發生。 |
Preview |
使用者使用此手寫筆進行系統手勢時發生。 |
Preview |
使用者將手寫筆移離平板電腦時發生。 |
Stylus |
使用者按下手寫筆上其中一個按鈕時發生。 |
Stylus |
使用者放開手寫筆上其中一個按鈕時發生。 |
Stylus |
使用者以手寫筆尖端碰觸平板電腦時發生。 |
Stylus |
手寫筆游標進入項目的邊界時發生。 |
Stylus |
手寫筆在平板電腦的範圍內 (但未碰觸) 移動時發生。 |
Stylus |
手寫筆進入平板電腦的範圍內時發生。 |
Stylus |
手寫筆游標離開項目的邊界時發生。 |
Stylus |
手寫筆碰觸平板電腦且移動時發生。 |
Stylus |
手寫筆超出平板電腦的範圍時發生。 |
Stylus |
使用者使用此手寫筆進行系統手勢時發生。 |
Stylus |
使用者將手寫筆移離平板電腦時發生。 |
產品 | 版本 |
---|---|
.NET Framework | 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9 |