Scripts in MDI forms - part II - the Mission

Hi.

You said that the AddForm should be used only one time for every Form Created.

How i need to create and re-create forms, i wrote you about that, and you said will
try to resolve in the next version of FS.

To resolve the problem while you don??t fix the 'bug', i??m using that:
procedure TMDIForm1.OnCreate(Sender: TObject);
begin
  with fsGlobalUnit do
  begin
    AddedBy := Self;
    AddForm(Self);
    AddedBy := nil;
  end;
end;

procedure TMDIForm1.OnClose(Sender: TObject; Action: TCloseAction);
begin
  fsGlobalUnit.Remove(Self);
  fsGlobalUnit.RemoveItens(Self); // will remove only objects created by itself.
end;

Well, it??s working fine, is there any problem to do that ? limitations or memory
problems ?

Thanks a lot.

Comments

  • edited 9:14AM
    wrote:
    Well, it??s working fine, is there any problem to do that ? limitations or memory
    problems ?

    Probably not.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.