Share via


StylusButton.StylusButtonState 屬性

定義

取得手寫筆按鈕的狀態。

public:
 property System::Windows::Input::StylusButtonState StylusButtonState { System::Windows::Input::StylusButtonState get(); };
public System.Windows.Input.StylusButtonState StylusButtonState { get; }
member this.StylusButtonState : System.Windows.Input.StylusButtonState
Public ReadOnly Property StylusButtonState As StylusButtonState

屬性值

其中一個 StylusButtonState 值。

範例

下列範例示範 StylusButtonState 屬性。

// Get the state of the StylusButton
switch (myStylusButton.StylusButtonState)
{
    case StylusButtonState.Down:
        textbox1.AppendText("StylusButton.State: Down\n");
        break;

    default:  // StylusButtonState.Up
        textbox1.AppendText("StylusButton.State: Up\n");
        break;
}
' Get the state of the StylusButton
Select Case myStylusButton.StylusButtonState
    Case StylusButtonState.Down
        textbox1.AppendText("StylusButton.State: Down" + vbCrLf)
    Case Else ' StylusButtonState.Up
        textbox1.AppendText("StylusButton.State: Up" + vbCrLf)
End Select

適用於