Solved

OnActivate Event after Showmodal Close

Posted on 1998-04-28
2
822 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
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…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses
Course of the Month6 days, 23 hours left to enroll

622 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