如果有两个checkbox我这样写
if checkbox1.checked = true then
begin
...........
end;
if checkbox2.checked = true then
begin
...........
end;
但是如果有30个checkbox应该怎样写呢?一个一个写太麻烦也不方便使用,我想这样写但是不行
for i=0 to 30 do
begin
if checkbox(i).checked = true then
begin
............
end;
end;
正确的写法应该是什么呢??
请大家帮帮忙,多谢了!!
if checkbox1.checked = true then
begin
...........
end;
if checkbox2.checked = true then
begin
...........
end;
但是如果有30个checkbox应该怎样写呢?一个一个写太麻烦也不方便使用,我想这样写但是不行
for i=0 to 30 do
begin
if checkbox(i).checked = true then
begin
............
end;
end;
正确的写法应该是什么呢??
请大家帮帮忙,多谢了!!
begin
if Tcheckbox(FindComponent('checkbox' +IntToStr(i))).checked = true then
begin
............
end;
end;
begin
if Tcheckbox(FindComponent('checkbox' +IntToStr(i))).checked = true then
begin
............
end;
end;