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

 

相关文章:

  • 2022-12-23
  • 2022-02-08
  • 2022-12-23
  • 2021-12-06
  • 2021-09-27
  • 2021-05-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-25
  • 2022-12-23
  • 2021-08-15
  • 2022-01-09
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案