Let’s clarify your doubt... You can do it this way. Since you have already included a Timer component on the screen called Timer1.
1º - Create an Ontimer event from the Timer component.
2º - Put the code, looking like this.
procedure TForm1.Timer1Timer(Sender: TObject);
begin
Gauge1.Progress := Gauge1.Progress + 1;
if Gauge1.Progress = 10 then
Image1.Picture.LoadFromFile('C:\contas_a_pagar\img\home\2.jpg')
else if Gauge1.Progress = 30 then
Image1.Picture.LoadFromFile('C:\contas_a_pagar\img\home\3.jpg')
else if Gauge1.Progress = 50 then
Image1.Picture.LoadFromFile('C:\contas_a_pagar\img\home\1.jpg');
end;
3º - Set the time when the Gauge1.Progress will be incremented in Timer1 on the property Interval, remembering that time is measured in ms, that is, 1000 is 1 second. If it is 1 according to the time set, in 10 seconds the process will change the image to 2.jpg, in 30 seconds 3.jpg and so on.
4º - When you want to start this count just put the Timer1 Enabled property in True, and otherwise False.
5º - In this case from 50 the image will always be 1.jpg, let’s say when the Gauge1.Progress to get to 60 we want to start counting again from 0. Then we change the code and put something like this:
procedure TForm1.Timer1Timer(Sender: TObject);
begin
Gauge1.Progress := Gauge1.Progress + 1;
if Gauge1.Progress = 10 then
Image1.Picture.LoadFromFile('C:\contas_a_pagar\img\home\2.jpg')
else if Gauge1.Progress = 30 then
Image1.Picture.LoadFromFile('C:\contas_a_pagar\img\home\3.jpg')
else if Gauge1.Progress = 50 then
Image1.Picture.LoadFromFile('C:\contas_a_pagar\img\home\1.jpg')
else if Gauge1.Progress = 60 then
Gauge1.Progress = 0;
end;
6th - Case o Gauge1.Progress cannot be reset, depending on the logic of your program, so create a variable in Form of type Integer to do this process. Getting something like:
private
contador: Integer;
...
...
procedure TForm1.Timer1Timer(Sender: TObject);
begin
Gauge1.Progress := Gauge1.Progress + 1;
Inc(contador);
if contador = 10 then
Image1.Picture.LoadFromFile('C:\contas_a_pagar\img\home\2.jpg')
else if contador = 30 then
Image1.Picture.LoadFromFile('C:\contas_a_pagar\img\home\3.jpg')
else if contador = 50 then
Image1.Picture.LoadFromFile('C:\contas_a_pagar\img\home\1.jpg')
else if contador = 60 then
contador = 0;
end;
don’t need to use a tgauge to control? , if you can be a little more specific
– Guilherme Lima
No Timmer already has a loop, the onTimer
– GabrielLocalhost
can edit your question and put an example of how it would look?
– Guilherme Lima