How to dynamically create controls aligned to the top but after other aligned controls?
Once again, DisableAlign and EnableAlign to the rescue: procedure TForm1.FormCreate(Sender: TObject); var I: Integer; P: TPanel; begin DisableAlign; try for I := 0 to 4 do begin P := TPanel.Create(Self); P.Caption := IntToStr(I); P.Align := alTop; P.Parent := Self; end; finally EnableAlign; end; end; Explanation: When alignment is enabled, every single addition of a control … Read more