How to enable a timer from a different thread/class

前端 未结 4 895
心在旅途
心在旅途 2020-12-21 05:27

Original post: How to access a timer from another class in C#

I tried everything.

-Event

-Invoke can\'t be done,because Timers don\'

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-21 06:03

    You should use the Timer class from the System.Timers namespace, and not the WinForms Timer control, if you want multi-threading support. Check the MSDN documentation for the WinForms Timer control for more information:

    http://msdn.microsoft.com/en-us/library/system.windows.forms.timer.aspx

提交回复
热议问题