Enable and disable Ttimer

2

How to enable and disable TTimer ? I have procedure :

procedure TForm3.Timer1Timer(Sender: TObject);

When I click on a download button, I enable Timer :

Timer1.enabled := true;

And when I click cancel it should stop Timer :

Timer1.enabled := False;

But that's not what happens. The Timer continues and is processing the data and displaying in a Label ... so I can stop the Timer instead I have to use:

Timer1.OnTimer :=  nil;

continues processing and showing on the screen.

What is the correct way to use timer in such a situation, enable and disable it?

    
asked by anonymous 20.11.2014 / 14:36

1 answer

0

To disable the timer simply type:

Timer1.enabled := False;

And to enable:

Timer1.enabled := True;

You should be disabling the timer in the wrong place.

    
21.11.2014 / 00:06