var
s1:
array
[
1..10
]
of
tshape; d,a:
integer
; n,i:
integer
; t1,t2,t3:
string
;
Form1: TForm1;
implementation
{$R *.dfm}
procedure
TForm1
.
Button1Click(Sender: TObject);
var
d:
integer
; B: TButton;
begin
for
i :=
1
to
strtoint(edit1
.
Text)
do
begin
B := TButton
.
Create(Self);
B
.
Caption := Format(
'extragerea'
+inttostr(i),[i]);
B
.
Parent := Self;
B
.
Height :=
23
;
B
.
Width :=
100
;
B
.
Left :=
10
;
B
.
Top :=
10
+ i *
25
;
end
;
for
i:=
1
to
strtoint(edit1
.
text)
do
begin
s1[i]:=tshape
.
Create(self);
s1[i].Parent:=self;
s1[i].Shape:=stcircle;
s1[i].Width:=
30
;
s1[i].height:=
30
;
s1[i].Top:=
30
;
s1[i].Left:=
130
+i*
30
;
randomize;
a:=random(strtoint(edit1
.
text));
if
a=
0
then
s1[i].Brush
.
Color:=clred; s1[i].Pen
.
Color:=clblack;
if
a=
1
then
s1[i].Brush
.
Color:=clblue; s1[i].Pen
.
Color:=clgreen;
if
a=
2
then
s1[i].Brush
.
Color:=clblack; s1[i].Pen
.
Color:=clred;
end
;
end
;
end
.