n:integer; //全局变量//button1事件:
var
a: integer;
begin
n:=0;
for a:=0 to CheckListBox1.Count-1 do
begin
if CheckListBox1.Checked[a] then
inc(n);
end;
end;这个代码用在程序里,好像不太正确,有些问题,我想是不是我的方法错了。
因为inc是累加,我是要直接得出已经被选中打勾的个数。
请各位帮忙了。
var
a: integer;
begin
n:=0;
for a:=0 to CheckListBox1.Count-1 do
begin
if CheckListBox1.Checked[a] then
inc(n);
end;
end;这个代码用在程序里,好像不太正确,有些问题,我想是不是我的方法错了。
因为inc是累加,我是要直接得出已经被选中打勾的个数。
请各位帮忙了。
解决方案 »
- ADOQuery的问题
- delphi中的string怎么转化为GB2312?
- 这才是斑主 hehe^^ 各位斑主进来学习一下哈
- Variable 'shul_sum' might not have been initialized
- ehlib导出excel是的问题
- 可以重复利用已有adoquery查询结果集吗,避免重复查询吗?
- 怎样把程序外的东西拖拽进入窗体?
- 如何对dbgrid中字段相同的列,压缩掉重复的列数据
- 各位大侠请各位帮忙!!!!,小弟急急,
- Delphi中的MIADS问题
- 关于分组统计的问题?
- 从D6开始,使用相同的算法、控件,生成的EXE文件好象比原来大了不少,是不是这样?
a: integer;
begin
n:=0;
for a:=0 to CheckListBox1.Count-1 do
begin
if CheckListBox1.Selected[a] then
inc(n);
end;
end;
还是刚才我的方法好像是对的。不过也谢谢了。
我自己再看看,可能是程序别的地方错了。