form close


[ Related Articles and Replies ] [ DelphiLand FAQ ] [ Delphi Tutorials ]

Posted by Letizia on May 10, 2002 at 17:33:38:

Can anyone tell me what TForm Close does in order to destroy the object it owns? Does it tests in some way if the objects still exist?
Creating a runtime instance of TTable and closing the Form from CloseBtClick I found that the code was compiled without error. I was making some test and some error was espected...

type
 TFormDB = class(Tform)
   ....
   CreateTabelBt: TButton;
   CloseBt: TButton;
 end;
var
 FormDB: TFormDB;
 NewTbl: TTable;
 NewDataSrc: TDataSource;
procedure TFormDb.CreateBtClick(Sender: TObject); 
begin
    NewTbl := TTable.Create(Self);
    with NewTbl do begin  
     .....
    end;
end;
procedure TFormDB.CloseBtClick(Sender: TObject);
begin
   NewTbl.Free;
   Close;
end;
Thanks in advance 

Related Articles and Replies:


[ Related Articles and Replies ] [ DelphiLand FAQ ] [ Delphi Tutorials ]