CLOSE A MDICHILD FORM
// ******************************************************************
// CLOSE A MDICHILD FORM
// Category : MDI
// Author : Carlos Borrero
// Author Email : cbarrer@elsitio.net.co
// Author Web :
// Tips Website : Swiss Delphi Center
// Tips Website URL: http://www.swissdelphicenter.ch
// ******************************************************************
unit Child;
// Have you noticed that when you try to close a MDIChild form
// the form minimizes but doesn’t disappear from your Main form
// client area?
//
// With this tip you can learn how to really close the MDI child
// form and free the memory occupied by the form
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
type
TMDIChildForm = class(TForm)
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Private declarations }
public
{ Public declarations }
end;
var
MDIChildForm: TMDIChildForm;
implementation
{$R *.DFM}
procedure TMDIChildForm.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
// This line of code frees memory and closes the form
Action := caFree;
end;
end.
No comments yet.
Leave a comment
-
Archives
- November 2007 (8)
- October 2007 (32)
-
Categories
-
RSS
Entries RSS
Comments RSS