Solved

OnActivate Event after Showmodal Close

Posted on 1998-04-28
2
801 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
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

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

11 Experts available now in Live!

Get 1:1 Help Now