Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2009-08

Issue: http://mantis.freepascal.org/view.php?id=14365

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

JoshyFun

Hello General,

As I can not post in not mine bugs I'll add the comment here:

The code does not perform the right job because the parent is changed but not the owner. I think that InsertControl should take care of this (AKA .Parent:=), so instead the user code this one will work as expected:

  while Instance.ComponentCount > 0 do begin
    Ctrl:=Instance.Components[0];
    Instance.RemoveComponent(Ctrl); //Removes owner control.
    AParent.Owner.InsertComponent(Ctrl); //Forces the owner change.
    if Ctrl Is TControl then AParent.InsertControl(TControl(Ctrl));
  end;
Best regards, JoshyFun

Reply by email