Color all controls on a form at runtime (Views: 26)
I want to color form controls at runtime without knowing beforehand how many and what controls there are.
TControlCracker = class(TControl);
procedure TForm1.Button1Click(Sender: TObject);
for I := 0 to ComponentCount - 1 do
if Components[I] is TControl then
TControlCracker(Components[I]).Color := clLime;
<< Back to main page