unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;

type
TForm1 = class(TForm)
Button1: TButton;
Panel1: TPanel;
Panel2: TPanel;
Panel3: TPanel;
Panel4: TPanel;
Panel5: TPanel;
Panel6: TPanel;
ListBox1: TListBox;
procedure Button1Click(Sender: TObject);
private

public

end;

var
Form1: TForm1;

implementation

uses Math;




procedure TForm1.Button1Click(Sender: TObject);
var
i,j,g:integer;
SayList:Array[1..49] of integer;

begin
i:=0;

for i := 1 to 49 do
begin
SayList[i]:=i;
end;

for i := 1 to 6 do
begin
for g:= 0 to ControlCount -1 do
begin
Randomize;
j:=RandomFrom(SayList);
if (Components[i] is TPanel ) then
TPanel(Components[i]).caption:= inttostr(j);
end;
end;

end;

end.
__________________