home *** CD-ROM | disk | FTP | other *** search
/ Delphi 4 Bible / Delphi_4_Bible_Tom_Swan_IDG_Books_1998.iso / source / FindComp / Findcomp.pas
Pascal/Delphi Source File  |  1998-02-12  |  325b  |  15 lines

  1. procedure TForm1.Button1Click(Sender: TObject);
  2. var
  3.   C: TComponent;
  4.   I, J, K: Integer;
  5. begin
  6.   K := 0;
  7.   for I := 0 to Form1.ComponentCount - 1 do
  8.   begin
  9.     C := FindComponent('CheckBox' + IntToStr(I + 1));
  10.     if C is TCheckBox then
  11.       with C as TCheckBox do
  12.         Checked := not Checked;
  13.   end;
  14. end;
  15.