Hmmmm- interesting.  The MastApp that comes with Delphi 2005 appears
to be different.  All forms are created at start time - a grep search
of the files show that they do not do that anywhere.  Same with the
IPMastApp.

jamie

--- In [email protected], David Smith <[EMAIL PROTECTED]> wrote:
>
> Straight out of the Delphi manual (the application
> creates a global variable automatically as the form's
> name when you create a new form):
> 
> 
> Put this in the form's OnClose event:
>    MyForm.Free;
>    MyForm := nil;
> 
> To create it (from anywhere):
> 
>   If MyForm <> nil Then 
> MyForm := TMyForm.Create(mainForm)
> 
>  (I always make the mainform the owner unless it's got
> an obvious child relationship to something else, that
> way it always gets freed during a GPF situation)
> 
>   If you create more than one, you can make sure
> you've freed them all by iterating through the
> Screen.Forms variable looking for that class type:
> 
> For i := 0 to Screen.Forms.count-1 do
>   If Screen.Forms[i] is TMyform then MyForm.close;
> 
>    See the demo's example under the folder:
> demos/db/MastApp. In fact, that application has an
> example of many useful tips to use in your own app.
> 
> Dave


Reply via email to