Check whether a mouse button is down.

To check whether a mouse button is down use the static Control.MouseButtons property.

Example:

if ((Control.MouseButtons & MouseButtons.Right ) == MouseButtons.Right )
{
..
}
Lastest update in May 2011, inital post in May 2011

Write a comment

I appreciate comments, suggestions, compliments etc. Unfortunately I have no time to reply to them. Useful input will be used for sure!