Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between Timer.Start and Timer.Enabled = True in vb.net?

Tags:

vb.net

timer

I'm wondering what the difference is between starting a timer and enabling a timer in vb.net?

like image 377
stackexchange12 Avatar asked Sep 05 '13 20:09

stackexchange12


People also ask

What is the difference between timer start and timer stop?

Submit Mar, 2018 1. timer.Stop() and timer.Start(), because they are subs of timer.Enabled. Feb, 2018 22. There is no such difference. Feb, 2018 6. Timer.Enable is to access the Timer Start and stop is to start or stop the timer if timer is not enabled we cannot start/stop the timer

What happens when you set the timer property to true?

Some visual designers, such as those in Microsoft Visual Studio, set the Enabled property to true when inserting a new Timer. Starts raising the Elapsed event by setting Enabled to true. Stops raising the Elapsed event by setting Enabled to false.

How to set timer to false at start of application?

If you want to set the timer to false at the beginning of the application (at loading) , you must used timer.Enabled = false, timer.Stop () won't work. This is why I use timer.Enabled = false/true.

What happens when you set the timer to 10 seconds?

If you reset the interval to 10 seconds when count is 3 seconds, the Elapsed event is raised for the first time 13 seconds after Enabled was set to true. Some visual designers, such as those in Microsoft Visual Studio, set the Enabled property to true when inserting a new Timer.


1 Answers

They both do the same thing. According to MSDN Start Method

Starts raising the Elapsed event by setting Enabled to true.

like image 111
Yuriy Galanter Avatar answered Oct 19 '22 01:10

Yuriy Galanter