Jak odwołać się do wszystkich komponentów, np TLabel
Gdzieś widziałem takie źrudło:
TForm1.Button1Click(Sender: TObject);
var
kolor_napis : TColor;
kolory : Integer;
begin
kolor_napis := kolor1.Selected; // kolor1 to komponent ColorBox
for kolory:=0 to componentcount do
if components[kolory] is TLabel then
TLabel(components[kolory]).Font.Color := kolor_napis ;
end;
Powyższy kod działa, tylko że zawsze wyskakuje taki błąd:
"List index out of bounds (124)"