procedure TForm1.SetLabelsFontColor(NewColor: TColor);
var
i: Integer;
begin
for i := 0 to ComponentCount - 1 do
if Components[i] is TLabel then
TLabel(Components[i]).Font.Color := NewColor;
end; Of course, you can use this technique to change other properties of other components. To change the color of all the edit components, use the following code: procedure TForm1.SetEditsColor(NewColor: TColor);
var
i: Integer;
begin
for i := 0 to ComponentCount - 1 do
if Components[i] is TEdit then
TEdit(Components[i]).Color := NewColor;
end; |
|
| Crash Course Delphi | Become member of the DelphiLand Club and get our Crash Course Delphi, plus the fully commented source code of numerous projects, plus guaranteed answers from our Q/A Forum. Membership is for life! |
TOP DelphiLand
Club Membership DC Library Forum Forum
Archives
Crash Course Delphi TURBO Delphi Explorer FAQ Tips Source
Code Downloads Links
© Copyright 1999-2006
Studiebureau Festraets