设置窗体属性KeyPreview=True。 private void Form1_KeyUp(object sender, KeyEventArgs e) { if (e.KeyData == Keys.Escape)Application.Exit(); }
Powered by: 博客园 Copyright © 2024 一佳一 Powered by .NET 9.0 on Kubernetes