var i: Integer; begin for i := 0 to ComponentCount - 1 do if Components[i] is TCheckBox then (Components[i] as TCheckBox).Checked := True; end;
For i:=1 to 6 do (FinComponent('checkbox'+inttostr(i)) as TCheckBox). ; 上面的点后可以加上你想做的属性等。
procedure tform1.bianlicombobox(Sender:TObject); var i : Integer; begin if Sender is TComboBox then TComboBox(Sender).Text:=''; if Sender is TCheckBox then TCheckBox(Sender).Checked:=true; if Sender is TPanel then begin for i:=0 to TPanel(Sender).ControlCount-1 do bianlicombobox(TPanel(Sender).Controls[i]); end; end;
begin
for i := 0 to ComponentCount - 1 do
if Components[i] is TCheckBox then
(Components[i] as TCheckBox).Checked := True;
end;
(FinComponent('checkbox'+inttostr(i)) as TCheckBox). ;
上面的点后可以加上你想做的属性等。
var i : Integer;
begin
if Sender is TComboBox then
TComboBox(Sender).Text:='';
if Sender is TCheckBox then
TCheckBox(Sender).Checked:=true;
if Sender is TPanel then
begin
for i:=0 to TPanel(Sender).ControlCount-1 do
bianlicombobox(TPanel(Sender).Controls[i]);
end;
end;