How do I capture Keys.F1 regardless of the focused control on a form?

前端 未结 4 1054
旧时难觅i
旧时难觅i 2020-11-30 06:37

I used KeyDown event and some simple code like if (e.KeyCode == Keys.F1) to capture F1 is pressed on a form BUT if there are some text boxes on the form or if t

4条回答
  •  无人及你
    2020-11-30 07:07

    Another way is to Override the ProcessCmdKey function http://msdn.microsoft.com/en-us/library/system.windows.forms.control.processcmdkey(v=VS.100).aspx

提交回复
热议问题