Thanks for your reply!
About the size of the child controls, they take as much space as they need, i.e. they define it themselfes. So the size shuould propagate from bottom to the top, as the "upper" controls need more space if they have more or larger children.
In the meanwhile I played around a little and came up with a solution, I think. As said I have a base class derived from TCustomControl (for testing I just used TPanel instead), and there I override the Resize event. Also I define a (virtual) ChildResize/OnChildResize event (doesn't exist in LCL). In the Resize event I call the parent's ChildResize, so the parent can adjust its dimensions. It can do it by iterating its children and arranging them adequately. Arranging, i.e. setting Top and Left doesn't trigger Resize events, so there is no infinite loop. When the parent adjusts its dimension, its own Resize is automatically called, triggering the ChildResize of their parent and so on, until the then parent is not from the common base class any more.
There was an issue, that the Resize event is called several times and before the parent was even set. With OnResize it works, but I prefer to leave it empty for further eventual usage. So I mimik the filtering code in the TControl's Resize Procedure, which seems to work fine.
procedure TItem.Resize;
begin
inherited Resize;
//Filter to have only one Resize event per actual resizing
if ([csLoading,csDestroying]*ComponentState<>[]) then exit;
if AutoSizeDelayed then exit;
if (Width=LastWidth) and (Height=LastHeight)
and (ClientWidth=LastClientWidth) and (ClientHeight=LastClientHeight) then EXIT;
LastWidth:= Width; LastHeight:= Height;
LastClientWidth:= ClientWidth; LastClientHeight:= ClientHeight;
writeln('Resize:',PtrUInt(self));
//Notify the parent
if Parent is TItem
then TItem(Parent).ChildResize(self);
end;
Procedure TItem.ChildResize(Sender:TObject);
var
ii,pp: Integer;
begin
writeln('ChildResize:',PtrUInt(self));
//Adjust the Child positions
if self.ControlCount=0 then EXIT;
pp:= 40;
for ii:= 0 to self.ControlCount-1 do begin
self.Controls[ii].Top:= pp;
pp:= pp + self.Controls[ii].Height;
end;
//Adjust the own size
self.Height:= pp+10;
end;