Hi, @Manjunath PM. Welcome to Microsoft Q&A.
You could try using StylusDevice.Inverted
to check whether the stylus tip or the eraser is currently being used.
For example: Bind OnStylusMove
to the StylusDown
event and edit the following code
private void OnStylusMove(object sender, StylusEventArgs e)
{
StylusDevice myStylusDevice = e.StylusDevice;
if (myStylusDevice != null)
{
if (myStylusDevice.Inverted)
{
textbox1.Text = "stylus moves with eraser down";
}
else
{
textbox1.Text = "stylus moves with pen down";
}
}
}
Related Documents: StylusDevice.Inverted Property (System.Windows.Input) | Microsoft Learn
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.