假设ado控件读取,在一个panel里生成chckbox
var
ck:tcheckbox;
t,l,x:integer;
begin
t:=0;
l:=0;
x:=0;
while not adoquery.eof do
begin
ck:=tcheckbox.create(self);
ck.caption:=adoquery.FieldValues['caption'];
ck.setbounds(l,t,panel1.clientwidth,ck.height);
ck.parent:=panel;
inc(t,ck.height+5);
inc(x,t);
adoquery.next;
end;
panel.clientheight:=x;
end;