Postanowiłem zrobić program z animowaną ikoną (tak, aby co pewien czas ikona formy się zmieniała na kolejną), przygotowałem 4 icony i umieściłem je w imagelist'cie, w onTimer Timer'a wpisałem:
procedure TForm1.Timer1Timer(Sender: TObject);
var
str,a:string;
b:integer;
begin
str := TimeToStr(Time);
if str = a then
begin
if b = 1 then
begin
imagelist1.geticon(0, form1.icon);
b:=2;
end;
if b = 2 then
begin
imagelist1.geticon(1, form1.icon);
b:=3;
end;
if b = 3 then
begin
imagelist1.geticon(2, form1.icon);
b:=4;
end;
if b = 4 then
begin
imagelist1.geticon(3, form1.icon);
b:=1;
end;
a:= TimeToStr(Time);
end;
end;
Problem próbowałem rozwiązać tak na chłopski rozum, ale mi nie wyszło, wie ktoś jak poprawić ten kod, aby działał?