Hello,
Thursday, August 11, 2005, 4:47:01 PM, Curtis cloud wrote:
> I have three forms total: form1, form2, and form3. Form1 and form 2 has the
> ability to call form3.
> Also, form 1 and 2 has timers that are triggered when they receive focus.
> Form3 has a close event associated to it.
> After form3 has been called by form1 or form2, then closes form3 should
> revert back to the form that called it which, by design, should activate
> its timer.
Easy. Store a reference of the form that called form3. You can either use a
global variable/public field, or add a constructor to form3 to pass the
reference as a parameter and store it in a private field. If you let Delphi
automatically create form3 you need to use the first approach, if you create
and destroy the form by yourself you should use the second. It would be more
or less like:
1) Using global variable or public field:
PreviousForm:=Self; // with "PreviousForm: TForm" declared in the interface
of form3
-or-
form3.PreviousForm:=Self; // with "PreviousForm: TForm" declared in the
public section of form3
form3.ShowModal;
2) Using a private field:
form3=Tform3.CreateModified(Application,Self);
form3.ShowModal;
and the constructor of form3 should be like:
constructor Tform3.CreateModified(AOwner:TComponent; APreviousForm:TForm);
begin
inherited Create(AOwner);
PreviousForm:=APreviousForm; // with "PreviousForm: TForm" declared in the
private section of form3
end
And when you need to activate the previous form simply use something like
"PreviousForm.Activate".
Regards.
--
Alberto Martinez Perez <[EMAIL PROTECTED]>
http://www.ampsoft.net/webdesign-l/
http://www.ampsoft.net/
______________________________________________
Renovamos el Correo Yahoo!
Nuevos servicios, más seguridad
http://correo.yahoo.es
------------------------ Yahoo! Groups Sponsor --------------------~-->
<font face=arial size=-1><a
href="http://us.ard.yahoo.com/SIG=12hprqseo/M=362329.6886308.7839368.1510227/D=groups/S=1705115362:TM/Y=YAHOO/EXP=1123794673/A=2894321/R=0/SIG=11dvsfulr/*http://youthnoise.com/page.php?page_id=1992
">Fair play? Video games influencing politics. Click and talk back!</a>.</font>
--------------------------------------------------------------------~->
-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED]
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/delphi-en/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/