How to disable navigation on WinForm with arrows in C#?

后端 未结 4 1618
情深已故
情深已故 2020-11-30 13:36

I need to disable changing focus with arrows on form. Is there an easy way how to do it?

Thank you

4条回答
  •  伪装坚强ぢ
    2020-11-30 14:36

    You should set KeyPreview to true on the form. Handle the KeyDown/KeyUp/KeyPress event and set the e.Handled in the eventhandler to true for the keys you want to be ignored.

提交回复
热议问题