How i can to Destory(free) a Form from memory?

Posted by user482923 on Stack Overflow See other posts from Stack Overflow or by user482923
Published on 2011-01-07T07:21:36Z Indexed on 2011/01/07 7:54 UTC
Read the original article Hit count: 128

Filed under:
|

Hello,

i have 2 Form (Form1 and Form2) in the my project, Form1 is Auto-create forms, but Form2 is Available forms. how i can to create Form2 and unload Form1?

I received a "Access validation" Error in this code.

Here is Form1 code:

1.  uses Unit2;
//*********
2.  procedure TForm1.FormCreate(Sender: TObject);
3.  var a:TForm2;
4.  begin
5.      a := TForm2.Create(self);
6.      a.Show;
7.      self.free;  // Or self.destory;
8.  end;

Thanks.

© Stack Overflow or respective owner

Related posts about delphi

Related posts about delphi-xe