Hi,

Haven't tried in D2005, but this works in D7.

The below procedure code considers 
1. "form1" is the default global variable created by Delphi in the 
unit.
2. There is always only one instance of form1 created at any time.
//------------------------
procedure Tform1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
    Action := caFree;
    form1  := nil;
end;
//-------------------------

To call this from another form (say, a Main Form)
//-------------------------
procedure TMainForm.Button1Click(Sender: TObject);
begin
    if form1 = nil then
        form1 := Tform1.Create(Application);
    form1.Show;
end;
//-------------------------


HTH,
Vishak

-----------------------------------------------------------------
--- In [email protected], "Jamie L. Mitchell" <[EMAIL PROTECTED]> 
wrote:
>
> Damn!  That is way clever by half.  And it appears to work 
correctly.
> 
> Thanks!
> 
> jamie
> 
> --- In [email protected], "Martin Wynne" <groups@> wrote:
> >
> >    > Having freed the form, the control is no
> >    > longer there to finish up. That has always
> >    > been the problem that I have run into.
> > 
> > Change the form's Tag property in the Close button event.
> > 
> > Read the Tag in the application's OnIdle event, and free
> > the form there.
> > 
> > Martin.
> >
>


Reply via email to