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; |
TOP DelphiLand
Club Membership DC Library Forum Forum
Archives
Crash Course Delphi Tips Source
Code Downloads Links
© Copyright 1999-2018
DelphiLand