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, представляющий используемое в данный момент перо.

Атрибуты

Примеры

В следующем примере показано, как стереть текст, выделенный с помощью инвертированного пера. В этом примере предполагается, что имеется вызываемая TextBoxtextBox1 и что StylusUpEvent событие подключено к обработчику событий.

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

Применяется к