OK I will sum up.
I have 3 forms, saying form0,1,2.
On form1, have :
TForm1 = class(TForm)
btnGrav: TButton;
btnOsc: TButton;
btnNewt: TButton;
btnChut: TButton;
btnEner: TButton;
procedure BtnNewtClick(Sender: TObject);
procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
Form2: TForm2;
implementation
{$R *.lfm}
{ TForm3 }
procedure TForm1.BtnNewtClick(Sender: TObject);
begin
Form2 := TForm2.Create(Self);
Form2.Show;
end;
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState
);
begin
LCLIntf.MessageBox(0, 'texte :' + sLineBreak +
'texte','about', 10000)
end;
end.
form2:
type
{ TForm2 }
TForm2 = class(TForm)
Image1: TImage;
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
procedure FormCreate(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form2: TForm2;
implementation
{$R *.lfm}
{ TForm2 }
procedure TForm2.FormCreate(Sender: TObject);
begin
Image1.Width := Self.ClientWidth;
Image1.Height := Self.ClientHeight;
end;
procedure TForm2.FormClose(Sender: TObject; var CloseAction: TCloseAction);
begin
CloseAction := caFree;
end;
end.
Is that ok, for the free memory procedure ? I dont think so, cause i have multiple formcreate events
with those, I have :
- Still the image in the same state in my android app, eg, the form wont closeitself, stil lthe same amount of RAM after closing the second form.
- The testbox coming from the menu button, still there when going back to form 0.
Staying in form1, textbox is show when pushing the menu button, back and pushing again, etc...
Gooing to form2 and back to form1, no text box when pushing the menu button.