//把分保存到CheckBox各自的Tag属性中
var
I: Integer;
S: Integer;
begin
S := 0;
for I := 0 to ComponentCount - 1 do
if (Components[I] is TCheckBox) and (TCheckBox(Components[I]).Checked) then
S := S + TChecckBox(Components[I]).Tag;
Caption := IntToStr(S);
end;
var
I: Integer;
S: Integer;
begin
S := 0;
for I := 0 to ComponentCount - 1 do
if (Components[I] is TCheckBox) and (TCheckBox(Components[I]).Checked) then
S := S + TChecckBox(Components[I]).Tag;
Caption := IntToStr(S);
end;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货