home *** CD-ROM | disk | FTP | other *** search
/ Delphi 4 Bible / Delphi_4_Bible_Tom_Swan_IDG_Books_1998.iso / source / OnClose / Onclose.pas
Pascal/Delphi Source File  |  1998-02-10  |  227b  |  8 lines

  1. procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
  2. begin
  3.   if MessageDlg('End the program?',
  4.     mtConfirmation, [mbYes, mbNo], 0) = mrYes
  5.     then CanClose := True
  6.     else CanClose := False;
  7. end;
  8.