共用方式為


MouseEventArgs.XButton2 屬性

定義

會顯示第二個延長滑鼠按鈕的狀態。

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 類別提供額外的屬性與方法來判定滑鼠狀態。

適用於