Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

OnActivate Event after Showmodal Close

Posted on 1998-04-28
2
Medium Priority
?
840 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 300 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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Loops Section Overview

886 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