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?