..
public
web:
array
of
TWebBrowser;
panel:
array
of
Tpanel;
const
allcount=
14
;
var
count:
integer
;
toppos:
integer
;
const
widthweb=
200
;
const
heightweb=
100
;
const
interval=
30
;
..
procedure
TForm1
.
WebCreate();
var
i,j,a,z,count:
integer
;
begin
showmessage(inttostr(allcount));
Form1
.
ScrollBox1
.
Width:=screen
.
Width;
Form1
.
ScrollBox1
.
Height:=screen
.
Height-Scrollbox1
.
Top;
Form1
.
toppos:=
20
;
showmessage(inttostr(Screen
.
Width));
count:=Floor(Screen
.
Width/(Form1
.
widthweb+Form1
.
interval));
showmessage(inttostr(count));
a:=floor(allcount/count);
SetLength(Form1
.
web,Form1
.
allcount-
1
);
SetLength(Form1
.
panel,Form1
.
allcount-
1
);
for
j :=
0
to
a
do
begin
for
i :=j*count
to
((j*count)+count-
1
)
do
begin
Form1
.
panel[i]:=TPanel
.
Create(self);
Form1
.
panel[i].Parent:=Form1
.
scrollbox1;
Form1
.
web[i]:=TWebBrowser
.
Create(Form1
.
panel[i]);
TWinControl(Form1
.
web[i]).Parent := Form1
.
panel[i];
if
i=j*count
then
begin
Form1
.
panel[i].Left:=
74
;
end
else
begin
Form1
.
panel[i].Left:=Form1
.
panel[i-
1
].Left+Form1
.
widthweb+Form1
.
interval;
end
;
Form1
.
panel[i].Top:=Form1
.
toppos;
Form1
.
web[i].Left:=
0
;
Form1
.
web[i].Top:=
0
;
Form1
.
web[i].Silent:=
true
;
Form1
.
panel[i].Width:=Form1
.
widthweb;
Form1
.
web[i].Width:=Form1
.
widthweb;
Form1
.
panel[i].Height:=Form1
.
heightweb;
Form1
.
web[i].Height:=Form1
.
heightweb;
if
i>Form1
.
allcount-
1
then
begin
Form1
.
web[i].Free;
Form1
.
panel[i].free;
end
;
end
;
Form1
.
toppos:=Form1
.
toppos+Form1
.
heightweb+Form1
.
interval;
end
;
end
;