I have a lot of labels in my form and I have to change the color to all of them, so I thought to use a for loop + the FindComponent
method.
procedure TForm1.RadioButton1Click(Sender: TObject);
var i:shortint;
begin
for i:=16 to 27 do
begin
TLabel(FindComponent('Label'+IntToStr(i)).Font.Color:=clYellow);
end;
Label85.Font.Color:=clYellow;
Label104.Font.Color:=clYellow;
end;
I'm using lazarus and I have this kind of error: identifier idents no member "Font"
. By the way as you can see Label104.Font.Color:=clYellow;
works (for example). How could I solve this?