Using System.Windows.Forms.Timer.Start()/Stop() versus Enabled = true/false

后端 未结 6 1649
闹比i
闹比i 2020-12-01 15:37

Suppose we are using System.Windows.Forms.Timer in a .Net application, Is there any meaningful difference between using the Start() and Stop() methods on the timer,

6条回答
  •  失恋的感觉
    2020-12-01 16:21

    I don't use timer.Stop() and timer.Start(), because they are subs of timer.Enabled. 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.

提交回复
热议问题