Solved

OnActivate Event after Showmodal Close

Posted on 1998-04-28
2
812 Views
Last Modified: 2008-02-01
To prevent the use of a form before closing an other form used the showmodal method. But now after closing the form the OnActivate event of the new Activeform will not appear.
Do i have to do something with the modalresult. Or is there another way to do this
0
Comment
Question by:rene041697
2 Comments
 

Accepted Solution

by:
leeberry2 earned 100 total points
ID: 1338065
You're quite correct. The OnActivate event is not triggered when your other form is closed. But, the OnShow event is. you could put your code here, but beware that this code will be executed every time the form is shown.

Alternatively your code in your main form that creates and shows the second might say something like:

Form2 := TForm2.Create(nil);
Try
  If Form2.ShowModal = mrOk then
  begin
    {perform the code you previously had in the OnActivate}
  end;
Finally
  Form2.Free;


Good Luck

Lee.

0
 

Author Comment

by:rene041697
ID: 1338066
Sure i can use the OnShow event, but only then when the first form is closed or hidden. Since i don't hide or close the first form the Onshow event will not appear. I still have to try the second option you mentioned.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

856 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