Das Einfachste wäre hier, erst garkeinen Owner anzugeben.
... := TMyForm.Create(nil)
.
Delphi-Quellcode:
// Owner entfernen
MyForm.Owner.RemoveComponent(MyForm);
// Owner hinzufügen
NewOwner.InsertComponent(MyForm);
Delphi-Quellcode:
procedure ChangeOwner(Component, NewOwner: TComponent);
begin
if Assigned(Component.Owner) then
Component.Owner.RemoveComponent(Component);
if Assigned(NewOwner) then
NewOwner.InsertComponent(Component);
end;
ChangeOwner(MyForm, NewOwner)