我希望动态生成checkbox控件,源代码如下:
for i:=1 to rs_cate.RecordCount do
begin
with TCheckbox.Create(Self) do
begin
Parent := Self;
name:='chkbox'+string(i);
Caption := 'Show me the money';
Left := 690;
Top := i*20;
end;
end;
不能成功。如果把for去掉直接生成一个就可以,请帮我看看是什么问题,谢谢。
还要就是想知道在checkboxlist控件中如何知道当前item被选择了。
for i:=1 to rs_cate.RecordCount do
begin
with TCheckbox.Create(Self) do
begin
Parent := Self;
name:='chkbox'+string(i);
Caption := 'Show me the money';
Left := 690;
Top := i*20;
end;
end;
不能成功。如果把for去掉直接生成一个就可以,请帮我看看是什么问题,谢谢。
还要就是想知道在checkboxlist控件中如何知道当前item被选择了。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货