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();
}
}