本文整理自网络,侵删。
1>.设置窗体的keypreview属性为:True;//可以接收键盘操作
2>、在窗体的键盘事件中写:
procedure TForm1.FormKeyPress(Sender: TObject; var Key: Char);beginif key = #27 then application.terminate; //关闭程序 end;
相关阅读 >>
Delphi 2009 indy10 idhttp get 中文出现乱码的问题
更多相关阅读请进入《Delphi》频道 >>