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