Mouse.XButton2 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
會顯示第二個延伸按鈕的狀態。
public:
static property System::Windows::Input::MouseButtonState XButton2 { System::Windows::Input::MouseButtonState get(); };
public static System.Windows.Input.MouseButtonState XButton2 { get; }
static member XButton2 : System.Windows.Input.MouseButtonState
Public Shared ReadOnly Property XButton2 As MouseButtonState
屬性值
第二個延長滑鼠按鍵的狀態。
範例
以下範例說明如何透過檢查 的 XButton2 狀態是否等 MouseButtonState 於列舉值 Pressed來判斷第二個延伸滑鼠按鈕是否被按下。 按下該按鈕時,會呼叫一個方法來更新樣本中的顯示元素。
if (Mouse.XButton2 == MouseButtonState.Pressed)
{
UpdateSampleResults("Second Extended Button Pressed");
}
If Mouse.XButton2 = MouseButtonState.Pressed Then
UpdateSampleResults("Second Extended Button Pressed")
End If