您的位置:首页 > 编程语言 > Delphi

delphi 动态创建 复选框控件

2012-05-31 09:37 369 查看
procedure TFrmSysIni.FormCreate(Sender: TObject);
var
I:Integer;
Col,Row:Integer;//第几列
begin
TabelList:=TStringList.Create;
DM1.ADOC1.GetTableNames(TabelList);
Col:=0; Row:=0;
For I:=0 to TabelList.Count-1 do
begin
if Col>13 then
begin
Col:=0;
Row:=Row +1 ;
end;
CheckList:=TRzCheckBox.Create(Self);
with CheckList do
begin
Parent:=RzPanel1;
Width:=140;
Height:=20;
Left:=16 +(Row*140);
Top:=16 + (Col*24);
Name:= 'CheckList'+inttostr(I);
Caption:= TabelList.Strings[I];
Visible:=true;
if TabelList.Strings[I]='COM_DB' then Enabled:=False;
if TabelList.Strings[I]='COM_PARA' then Enabled:=False;
if TabelList.Strings[I]='TIME_SORT' then Enabled:=False;
if TabelList.Strings[I]='TIME_RULE' then Enabled:=False;
if TabelList.Strings[I]='COM_CODE' then
begin
//Enabled:=False;
Color:=clRed;
// OnClick:=CheckListOnClick;
end;
if TabelList.Strings[I]='CHARGE_STATION' then Enabled:=False;

Transparent:=True;
end;
Col:=Col +1;
end;
end;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: