Tag Archives: button

Programmatically press a buton, checkbox etc

To programmatically press a button , checkbox, radiobutton or controls derived from ButtonBase or implementing the IbuttonControl interface use the PerformClick method.

button1.PerformClick();
Lastest update in May 2011, inital post in May 2011

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