--> Tricks MessageBox displays a message when the form on the close. This way when we give a close form, the message will be displayed. | Delphi Tips Trick

For Newbie

Tuesday, 15 November 2011

Tricks MessageBox displays a message when the form on the close. This way when we give a close form, the message will be displayed.

| Tuesday, 15 November 2011


Edit event on FormCloseQuery:
TForm1.FormCloseQuery procedure (Sender: TObject; var CanClose: Boolean);
begin
   if MessageBox (Handle, 'Get out of the application?', 'Confirmation',
                 MB_ICONQUESTION MB_YESNO +) = idYes then
     CanClose: = True
   else
     CanClose: = False;
end;

Related Posts

No comments: