Threading.Timer vs. Forms.Timer

前端 未结 3 1802
忘掉有多难
忘掉有多难 2020-12-13 14:45

The short form of this question: When, if ever, is it appropriate to use the Forms.Timer in a multithreaded WinForms application?

More specifically, I am architectin

3条回答
  •  借酒劲吻你
    2020-12-13 15:34

    Forms.Timer registers the timer to send a message when the timer goes off. The event raised is treated like a GUI event. System.Threading.Timer uses a thread blocking approach. Basically, you should use Forms.Timer for your GUI oriented timers (to add some effects to the user interface) and Threading.Timer for scheduling tasks and other things.

提交回复
热议问题