System.Timers.Timer hangs the Windows Forms application in c#

前端 未结 2 1015
逝去的感伤
逝去的感伤 2021-01-28 03:49

The code below shows a timer that ticks every 100* 1000(milliseconds) to show a pop up message for registration.The below code is working but unfortunately my application gets h

2条回答
  •  一向
    一向 (楼主)
    2021-01-28 04:41

    The application hangs because you're doing a popup (I assume a MessageBox or some other modal dialog box). Of course the application is going to hang. You're putting a modal dialog up in the UI thread.

    The problem isn't with the timer, but with your application design.

提交回复
热议问题