start a timer from different thread in c#

后端 未结 4 1778
挽巷
挽巷 2020-12-16 15:37

Hi i have stepped into some problem related to timer. hope somebody can help..

  1. I have a windows form containing a button
  2. when i click on that button i
4条回答
  •  情话喂你
    2020-12-16 16:06

    I would use a BackgroundWorker (instead of a raw thread). The main thread would subscribe to the worker's RunWorkerCompleted event: The event fires in your main thread when the thread completes. Use this event handler to restart your timer.

提交回复
热议问题