Panel里面有多个CheckBox控件,如何判断Panel里面有多少个CheckBox打勾了?
解决方案 »
- 正则表达式提取网页链接url
- 用copymemory复制string的问题
- 汗,delphi7中的quickreport在组建栏里没有了么,是不是要自己安装的啊??
- 急急!!!!请教各位虾哥虾姐: 如何让一个树的分支变成灰色(无效)???
- 如何将int64写入tstream,并从tstream中读取?
- 如何知道光标移出或移进控件(如:panel)?
- 请问 各位大侠谁买到D版的 delphi6.0 中文版了?不是汉化版了。
- Illegal character in input file:' '($A1A1) 是什么错误啊?
- 用wingate作为代理服务器, 在客户端用qq上网,在wingate服务器端需要怎样配置。
- 将一批*.html文件转化为*.txt文件如何处理??谢谢~~~~~~
- 请问怎么把鼠标中键禁止掉?
- 如何做.CHM文件?
i, iCount: Integer;
begin
iCount := 0;
for i := 0 to Self.ComponentCount - 1 do
begin
if (Self.Component[i] is TCheckBox) and
(Self.Component[i] as TCheckBox).Checked then
begin
Inc(iCount);
end;
end;
end;
begin
i := 0;
for j := 0 to Panel1.ControlCount - 1 do
begin
if panel1.Controls[j].ClassType = TCheckBox then
if TCheckBox(Panel1.Controls[j]).checked then
inc(i);
end;
ShowMessage(IntToStr(i));
end;
procedure TForm1.Button1Click(Sender: TObject);
var
i,j: Integer;
begin
j := 0 ; for I := 0 to Panel1.ControlCount - 1 do // Iterate
begin
if Panel1.Controls[i] is TCheckBox then
begin
if TCheckBox(Panel1.Controls[i]).Checked then
begin
Inc(j);
end;
end;
end;
其中的Panel1就是要指定的那个Panel