Timer不执行Elapsed事件的解决办法

Timer.Start() 了但只执行了一次Elapsed事件就停止不执行了,原因是您在设置Timer控件属性的时候没有设置AutoResettrue

如果将 Enabled 设置为 true 并将 AutoReset 设置为 false,则 Timer 在第一次达到间隔时仅引发一次 Elapsed 事件。当 Enabledtrue 并且 AutoResettrue 时,Timer 继续按指定的间隔引发 Elapsed 事件。
posted on 2008-01-29 16:18  Gary.han  阅读(1886)  评论(0编辑  收藏  举报