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。 无默认值。

示例

如果 属性的状态 XButton2Pressed,以下示例将打印一条消息。

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 提供用于确定鼠标状态的其他属性和方法。

适用于