2014年1月23日 星期四

隨時按ESC離開視窗

首先在Additional->新增一個ApplicationEvents,然後在事件OnShortCut新增下列程式碼:
procedure TFmain.ApplicationEvents1ShortCut(var Msg: TWMKey;var Handled:Boolean);
begin
      if (TWMKey(Msg).CharCode = VK_ESCAPE) then self.close
end;

沒有留言:

張貼留言