MouseButton Enumeration
.NET Framework (current version)
Defines values that specify the buttons on a mouse device.
Assembly: PresentationCore (in PresentationCore.dll)
| Member name | Description | |
|---|---|---|
| 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.
.NET Framework
Available since 3.0
Available since 3.0
Show: