设置窗体属性KeyPreview=True。
private void Form1_KeyUp(object sender, KeyEventArgs e)
{
  if (e.KeyData == Keys.Escape)Application.Exit();
}

来自:http://zhidao.baidu.com/question/17393332.html

相关文章:

  • 2021-09-28
  • 2022-12-23
  • 2022-02-08
  • 2022-12-23
  • 2021-08-17
  • 2021-07-20
  • 2022-12-23
  • 2021-12-19
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-04
  • 2022-01-14
  • 2022-12-23
  • 2021-10-08
相关资源
相似解决方案