detect ctrl+left click (for button) in winforms application
+7
A:
You need to check the value of Form.ModifierKeys to see if Control was pressed, e.g.:
btn.Click += new EventHandler(btn_Click);
private void btn_Click(object sender, EventArgs e)
{
if (Form.ModifierKeys == Keys.Control)
{
// Do Ctrl-Left Click Work
}
}
JDunkerley
2009-09-17 14:03:55
Ahhhh. I always wondered about this..
Tor Haugen
2009-09-17 14:08:25