I made some game as a console application, and now I want to move it to the Windows Forms.
In the console mode I use the Thread.Sleep() function to slow some elements in my game (They move from the top to the bottom of the window), but when I use the function in Windows Form application it makes the application window busy. I have to turn off the program by ALT+F4 then.
How can I fix it or is there any way to do that?
I made some game as a console application, and now I want to move
Share
You should use
System.Windows.Forms.TimerPlease note that you should not use System.Timers.Timer
From MSDN: In the .NET Framework version 2.0 and earlier, the Timer component catches and suppresses all exceptions thrown by event handlers for the Elapsed event. This behavior is subject to change in future releases of the .NET Framework. It does not say if it have been changed yet or not.