MouseEventArgs.XButton2 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
會顯示第二個延長滑鼠按鈕的狀態。
public:
property System::Windows::Input::MouseButtonState XButton2 { System::Windows::Input::MouseButtonState get(); };
public System.Windows.Input.MouseButtonState XButton2 { get; }
member this.XButton2 : System.Windows.Input.MouseButtonState
Public ReadOnly Property XButton2 As MouseButtonState
屬性值
第二個延長滑鼠按鈕的當前狀態,要麼PressedReleased是 。 沒有預設值。
範例
以下範例若屬性 XButton2 狀態為 Pressed,則列印訊息。
if (e.XButton2 == MouseButtonState.Pressed)
{
MessageBox.Show("The XButton2 Mouse Button is pressed");
}
If e.XButton2 = MouseButtonState.Pressed Then
MessageBox.Show("The XButton2 Mouse Button is pressed")
End If
備註
該 Mouse 類別提供額外的屬性與方法來判定滑鼠狀態。