c#如何esc退出Form

来源:互联网 发布:linux telent 安装 编辑:程序博客网 时间:2024/06/03 18:12
private void Form1_KeyDown(object sender, KeyEventArgs e)        {            if (e.KeyCode == Keys.Escape)            {                this.Close();            }        }

记得把 Forn的 keyPreview 设为 true
0 0
原创粉丝点击