首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

急在panel中自动创建checkbox,提示已经存在,可就是看不见阿。该怎么解决

2012-02-25 
急,在panel中自动创建checkbox,提示已经存在,可就是看不见阿。急procedureTForm2.Button1Click(Sender:TObj

急,在panel中自动创建checkbox,提示已经存在,可就是看不见阿。急
procedure   TForm2.Button1Click(Sender:   TObject);
var   check:Tcheckbox;
begin
.....
check:=Tcheckbox.create(self.Panel1);
check.Name:= 'checkbox '+inttostr(i);
check.Visible:=true;
check.Caption:=adoquery1.Fields[i].fieldname;
check.Left:=15;
check.Width:=75;
check.Height:=25;
check.Checked:=false;

end;

[解决办法]
check.Parent:=Self.Panel1;
[解决办法]
....
check:=Tcheckbox.create(Owner);
check.Parent:=self.Panel1;
....
[解决办法]
check:=Tcheckbox.create(self.Panel1);
check.Parent := Self.Panel1; //加上这一句
check.Name:= 'checkbox '+inttostr(i);
check.Visible:=true;
......

热点排行