Script works only in the first time.
Hi.
Adding a MDI form with fsGlobalUnit.AddForm(Form_Sample) works only in the first time. When i close the form and free-it by:
procedure TForm_Sample.OnClose(Sender: TObject; var Action: TCloseAction);
begin
Form_Sample := nil; // so i can test if itself is nil and recreate-it.
Action := caFree; // free the mdi form, the window must be closed.
end;
When i try to create the same form Form_Sample, the script doesn??t works anymore. I??m using the following code in the script:
begin
Form_Sample.Label2.Caption := 'Test';
end.
In the OnCreate event of the form, i??m adding itself by AddForm(Self).
Is that correct ? Please, i need help. Many days ago i??m trying to do that.
Thanks a lot.
Adding a MDI form with fsGlobalUnit.AddForm(Form_Sample) works only in the first time. When i close the form and free-it by:
procedure TForm_Sample.OnClose(Sender: TObject; var Action: TCloseAction);
begin
Form_Sample := nil; // so i can test if itself is nil and recreate-it.
Action := caFree; // free the mdi form, the window must be closed.
end;
When i try to create the same form Form_Sample, the script doesn??t works anymore. I??m using the following code in the script:
begin
Form_Sample.Label2.Caption := 'Test';
end.
In the OnCreate event of the form, i??m adding itself by AddForm(Self).
Is that correct ? Please, i need help. Many days ago i??m trying to do that.
Thanks a lot.
Comments
I'll try to fix it in the next release.
Well, it??s working fine, is there any problem to do that ? limitations or memory
problems ?
Thanks a lot.