Forms not responding to KeyDown events

前端 未结 3 1318
长发绾君心
长发绾君心 2020-11-29 04:55

I\'ve been working for a while on my Windows Forms project, and I decided to experiment with keyboard shortcuts. After a bit of reading, I figured I had to just write an eve

3条回答
  •  长情又很酷
    2020-11-29 05:32

    Does your form have KeyPreview property set to true?

    Form.KeyPreview Property

    Gets or sets a value indicating whether the form will receive key events before the event is passed to the control that has focus.

    http://msdn.microsoft.com/en-us/library/system.windows.forms.form.keypreview.aspx

提交回复
热议问题