Stylus.CurrentStylusDevice Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the stylus that represents the stylus currently in use.
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
Property Value
The StylusDevice that represents the stylus currently in use.
- Attributes
Examples
The following example demonstrates how to erase the text that is selected with an inverted stylus. This example assumes that there is a TextBox called textBox1
and that the StylusUpEvent event is connected to the event handler.
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
Applies to
ทํางานร่วมกับเราใน GitHub
แหล่งที่มาสำหรับเนื้อหานี้สามารถพบได้บน GitHub ซึ่งคุณยังสามารถสร้างและตรวจสอบปัญหาและคำขอดึงข้อมูลได้ สำหรับข้อมูลเพิ่มเติม ให้ดูคู่มือผู้สนับสนุนของเรา