procedure TForm1.Button1Click(Sender: TObject);
var
Button: TPanel;
begin
Button:=TPanel.Create(Form1);
try
with Button do
begin
Parent:=pc;
Name:='Btn'+inttostr(id);
//Left:=0;//Random(Form1.ClientWidth-Width);
//Top:=0;//Random(Form1.ClientHeight-Height);
Align:=alLeft;
Caption:='ButtonX'+inttostr(id);
Inc(id);
end;
except
Button.Free;
end;
end;