把40个checkbox定义成对象数组carray:array[1..40] of tcheckbox,怎么在程序中用carray[i],我主要想用checkbox的checked的属性。我在窗体上有40个checkbox,一个button,button的单击事件是
for i:=1 to 40
if carray[i].checked:=true then
n:=n+1;
但此程序在运行时出现错误,请高手帮忙
for i:=1 to 40
if carray[i].checked:=true then
n:=n+1;
但此程序在运行时出现错误,请高手帮忙
if carray[i].checked = true then
n:=n+1;
变成if carray[i].checked=true then
begin
if carray[i].checked:= true
n:=n+1;
continue;
end;
根本编译不了嘛:)
楼主也没贴全
可能是没写
for i := 1 to 40
carray[i] := TCheckBox.Create(Self);