共用方式為


Stylus.CurrentStylusDevice 屬性

定義

取得手寫筆,表示目前使用中的手寫筆。

public:
 static property System::Windows::Input::StylusDevice ^ CurrentStylusDevice { System::Windows::Input::StylusDevice ^ get(); };
public static System.Windows.Input.StylusDevice CurrentStylusDevice { [System.Security.SecurityCritical] get; }
public static System.Windows.Input.StylusDevice CurrentStylusDevice { get; }
[<get: System.Security.SecurityCritical>]
static member CurrentStylusDevice : System.Windows.Input.StylusDevice
static member CurrentStylusDevice : System.Windows.Input.StylusDevice
Public Shared ReadOnly Property CurrentStylusDevice As StylusDevice

屬性值

表示目前使用中之手寫筆的 StylusDevice

屬性

範例

下列範例示範如何清除以反手寫筆選取的文字。 這個範例假設有一個 TextBox 呼叫 textBox1StylusUpEvent 而且事件已連線到事件處理程式。

void TextBoxStylusUp(object sender, StylusEventArgs e)
{
    StylusDevice currentStylus = Stylus.CurrentStylusDevice;

    if (currentStylus.Inverted)
    {
        string selectedText = textbox1.SelectedText;
        textbox1.SelectedText = "";
    }
}
Private Sub TextBoxStylusUp(ByVal sender As Object, ByVal e As StylusEventArgs) _
    Handles textbox1.StylusUp

    Dim currentStylus As StylusDevice = Stylus.CurrentStylusDevice

    If currentStylus.Inverted Then
        Dim selectedText As String = textbox1.SelectedText
        textbox1.SelectedText = ""
    End If

End Sub

適用於