Delphi Tips Trick

For Newbie

Iklan Responsive Atas

LightBlog
Responsive Ads Here

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.



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;

No comments: