Solved

Waiting...

Posted on 2004-08-19
3
182 Views
Last Modified: 2010-04-05
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;
0
Comment
Question by:-Karamja-
3 Comments
 
LVL 3

Accepted Solution

by:
Tyrsis earned 40 total points
Comment Utility
Just use:

Form2.ShowModal;
0
 
LVL 3

Expert Comment

by:KyleyHarris
Comment Utility
Agreed. Showmodal.
0
 
LVL 12

Expert Comment

by:esoftbg
Comment Utility
Tyrsis is right:
procedure TForm1.Button1Click(Sender: TObject);
begin
  Form2.ShowModal;
  //Form2 Is Closed By User
  ShowMessage('You Closed Form2');
end;
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now