Waiting...

Hello,

How can I show a form then wait until that form is closed before going on with code.
E.g

Form2.Show;
//Form2 Is Closed By User
ShowMessage('You Closed Form2');

But I dont want this.

procedure TForm2.FormClose(Sender: TObject; var Action: TCloseAction);
begin
ShowMessage('You Closed Form2');
end;
LVL 2
-Karamja-Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
TyrsisConnect With a Mentor Commented:
Just use:

Form2.ShowModal;
0
 
KyleyHarrisCommented:
Agreed. Showmodal.
0
 
esoftbgCommented:
Tyrsis is right:
procedure TForm1.Button1Click(Sender: TObject);
begin
  Form2.ShowModal;
  //Form2 Is Closed By User
  ShowMessage('You Closed Form2');
end;
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.