MouseButton Enumeration

 

Defines values that specify the buttons on a mouse device.

Namespace:   System.Windows.Input
Assembly:  PresentationCore (in PresentationCore.dll)

public enum class MouseButton

Member nameDescription
Left

The left mouse button.

Middle

The middle mouse button.

Right

The right mouse button.

XButton1

The first extended mouse button.

XButton2

The second extended mouse button.

The following example creates a MouseDown event handler that uses the MouseButton enumeration to determine which button was pressed. Depending on which button was pressed, the background of the control that fired the event is changed.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 3.0
Return to top
Show: