30个checkbox,下面的操作是可以的
for i:= 1 to 30 do
begin
TCheckBox(FindComponent('checkbox'+inttostr(i))).Enabled := false;
end;可是,我想判断他的状态,我这样写,却不行,这是为什么?
for i:= 1 to 30 do
begin
if TCheckBox(FindComponent('checkbox'+inttostr(i))).checked then
......;
end;
for i:= 1 to 30 do
begin
TCheckBox(FindComponent('checkbox'+inttostr(i))).Enabled := false;
end;可是,我想判断他的状态,我这样写,却不行,这是为什么?
for i:= 1 to 30 do
begin
if TCheckBox(FindComponent('checkbox'+inttostr(i))).checked then
......;
end;
for i:= 1 to 30 do
begin
if TCheckBox(panel1.FindComponent('checkbox'+inttostr(i))).checked then
......;
end;