> This is an MDI app, and when a form closes in an MDI environment it simply > minimizes to the bottom of the main form, and therefore doesn't > release its > memory, and looks damned ugly! >
In the OnClose handler of the MDI Child form: procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction); begin Action := caFree; end; Also note that if you are freeing the form, then the global variable declared in the unit becomes invalid. Generally speaking, with MDI Apps, the MDI Children should not be an Auto-Create form as specified in the Project Options. If you are freeing the form in the OnClose handler, then you will get a GP Fault, since the rest of the TForm.Close method references the object that has just been freed. --------------------------------------------------------------------------- New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] Website: http://www.delphi.org.nz To UnSub, send email to: [EMAIL PROTECTED] with body of "unsubscribe delphi" Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/