We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Detecting Ctrl-click in a mouse controller

I need to take a different action when the user is holding the control key while clicking with the mouse. How can I do this in the mouse controller? Is there a way to get the grid to pass key events into the mouse controller?

1 Reply

SH Sue Harris September 18, 2003 10:11 PM UTC

> I need to take a different action when the user is holding the control key while clicking with the mouse. How can I do this in the mouse controller? Is there a way to get the grid to pass key events into the mouse controller? You can use the static Control property KeyModifiers to do this. (This example from the microsoft help.. copyright Microsoft Corporation etc etc): private void button1_Click(object sender, System.EventArgs e) { /* If the CTRL key is pressed when the * control is clicked, hide the control. */ if(Control.ModifierKeys == Keys.Control) { ((Control)sender).Hide(); } }

Loader.
Live Chat Icon For mobile
Up arrow icon