Hola.
Un ejemplo de como podes crearlos y mostrarlos en forma de matriz:
Código Delphi
[-]
...
var
v: array of array of TButton;
procedure TForm1.btnCrearButtonsClick(Sender: TObject);
var
MaxC, MaxR, c, r: Integer;
iTop, iLeft: Integer;
iHeight, iWidth , nn: Integer;
begin
MaxC := StrToInt(edit1.Text); MaxR := StrToInt(edit2.text); SetLength(v, MaxC+1, MaxR+1);
iWidth := 75; iHeight := 25; iTop := 100; nn := 1;
for c := 1 to MaxC do
begin
iLeft := 100; for r := 1 to MaxR do
begin
v[c,r] := TButton.Create(Self);
v[c,r].Name := 'DynButton' + IntTostr(nn);
v[c,r].Caption := v[c,r].Name;
v[c,r].Width := iWidth;
v[c,r].Height := iHeight;
v[c,r].Top := iTop;
v[c,r].Left := iLeft;
v[c,r].Parent := Self;
Inc(iLeft, iWidth + 15); Inc(nn); end;
Inc(iTop, iHeight + 25); end;
end;
(no incluye liberación de recursos ni comprobación alguna)
Saludos
