新建一个工程,窗口属性 KeyPreview =True, 然后在 FormKeyPress 里写 if key = #27 then Application.Terminate;
问题:
当窗口 FormStyle 属性为 fsNormal 时,运行程序,按ESC 键,窗口是可以关闭的。
但当 FormStyle 属性为 fsMDIForm 时,运行程序,按ESC ,窗口没反应。感觉没接收到 ESC键
请大神指点
新建一个工程,窗口属性 KeyPreview =True, 然后在 FormKeyPress 里写 if key = #27 then Application.Terminate;
问题:
当窗口 FormStyle 属性为 fsNormal 时,运行程序,按ESC 键,窗口是可以关闭的。
但当 FormStyle 属性为 fsMDIForm 时,运行程序,按ESC ,窗口没反应。感觉没接收到 ESC键
请大神指点
MDI子窗口不能关闭应用程序,要主窗口才可以。