Board index » cppbuilder » Deleting Modeless Forms

Deleting Modeless Forms


2004-10-15 03:51:08 PM
cppbuilder96
If I dynamically create an instance of TForm and I use its Show method to
display it (i.e. a non-modal dialog).
Please remind me what to do to ensure that the TForm instance is deleted
once the form is closed.
 
 

Re:Deleting Modeless Forms

Celtis wrote:
Quote
Please remind me what to do to ensure that the TForm instance is deleted
once the form is closed.
Implement the OnClose eventhandler:
void __fastcall TForm1::FormClose(TObject *Sender,
TCloseAction &Action)
{
Action = caFree;
}
Hans.
 

Re:Deleting Modeless Forms

Thanks Hans! You are a star!
"Hans Galema" < XXXX@XXXXX.COM >wrote in message
Quote
Celtis wrote:

>Please remind me what to do to ensure that the TForm instance is deleted
>once the form is closed.

Implement the OnClose eventhandler:

void __fastcall TForm1::FormClose(TObject *Sender,
TCloseAction &Action)
{
Action = caFree;
}

Hans.
 

{smallsort}