How to avoid issues when embedding a TForm in another TForm?

I do this as well and I use the following routine to make it happen:

procedure TMyForm.PlaceInsideContainer(Container: TWinControl);
begin
  Parent := Container;
  Align := alClient;
  BorderIcons := [];
  BorderStyle := bsNone;
  ParentBackground := True;
  Show;
end;

I have no problems with this. The only difference that I could possibly imagine could be relevant is the assignment of BorderIcons, but I would doubt that causes a problem.

Leave a Comment