在窗体属性的杂项里实在找不到就在窗体的 Load 事件中加入 this.KeyPreview = true; 不用导入包你是建的c#窗体程序吗
窗体的keyPreview属性设置为truethis.KeyPreview = true;
要写 Form 的 KeyDown事件