我程序中用了10个checkbox控件,名字checkbox1、checkbox2...
我想得到如下结果,当选中某个checkbox1时,显示出该checkbox名字后面的数字,即选中checkbox1和checkbox2显示为1,2。我用了逐个遍历的方法。
if checkbox1.checked then
label1.caption:=label1.caption+'1';
if checkbox2.checked then
label1.caption:=label1.caption+'2';
........
请问有没有简单的方法?