Board index » delphi » Forms Instances

Forms Instances


2004-10-26 08:22:38 AM
delphi217
Hi, in Delphi 6 I am creating new forms as in the following code:
// show location selection dialog
Application.CreateForm(TFormSelectLocation, FormSelectLocation);
FormSelectLocation.ShowModal;
What happens is the first time the form is ran it is name is
FormSelectLocation, the second time it is FormSelectLocation_1, ..._2, and
so on. But the form is modal and is closed before it is ever created again,
so I am wondering why would it create these new names/instances since there
should only ever be one instance running at a time? Are my modal forms not
closing or being destroyed properly? Thanks,
Steve A.
 
 

Re:Forms Instances

Ok, I found out I wasn't using the .Release method. When I do all works as I
would expect.
How can I Release a non-modal form though? I assume Release can not be ran
from within a Form's Close event...
Steve A.
"Steve Anderson" <XXXX@XXXXX.COM>writes
Quote
Hi, in Delphi 6 I am creating new forms as in the following code:

// show location selection dialog
Application.CreateForm(TFormSelectLocation, FormSelectLocation);
FormSelectLocation.ShowModal;

What happens is the first time the form is ran it is name is
FormSelectLocation, the second time it is FormSelectLocation_1, ..._2, and
so on. But the form is modal and is closed before it is ever created
again, so I am wondering why would it create these new names/instances
since there should only ever be one instance running at a time? Are my
modal forms not closing or being destroyed properly? Thanks,

Steve A.