Author: Jonas Bilinkevicius
I want to color form controls at runtime without knowing beforehand how many and
what controls there are.
Answer:
1 type2 TControlCracker = class(TControl);
3 4 procedure TForm1.Button1Click(Sender: TObject);
5 var6 I: Integer;
7 begin8 for I := 0 to ComponentCount - 1 do9 if Components[I] is TControl then10 TControlCracker(Components[I]).Color := clLime;
11 end;