📜  退出表单 esc winforms - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:06.729000             🧑  作者: Mango

代码示例5
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            if (keyData == (Keys.Escape))
            {
                Close();
                return true;
            }

            return base.ProcessCmdKey(ref msg, keyData);
        }