Test if the Ctrl key is down using C#

后端 未结 6 1248
一整个雨季
一整个雨季 2020-12-01 09:59

I have a form that the user can double click on with the mouse and it will do something. Now I want to be able to know if the user is also holding the Ctrl key do

6条回答
  •  误落风尘
    2020-12-01 10:44

    Even this also

     private void Control_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (ModifierKeys == Keys.Control)
                MessageBox.Show("with CTRL");
        }
    

提交回复
热议问题