This seems to work well until I try to create the 11th button. Any suggestions?
procedure TForm1.FormClick(Sender: TObject);
var
nb: TButton;
begin
Inc(n);
nb := TButton.Create(Self);
nb.OnClick := ButtonClick;
SetLength(ca, n);
ca[n] := nb;
ca[n].Left := 8;
ca[n].Top := (((n - 1) * nb.Height) + 8);
ca[n].ParentWindow := Form1.Handle;
end;