1
I’m trying to get a panel to constantly change color with the following code
while (true)
{
panelColor.BackColor = Color.Blue;
Thread.Sleep(500);
panelColor.BackColor = Color.Red;
Thread.Sleep(500);
}
The problem is that the application hangs every time it comes to this part, someone can tell me why?
This is an infinite loop, the execution will never leave it.
– ramaral
theoretically should not keep changing colors with the 500 milliseconds interval in this loop?
– TotallyUncool
thanks for the help, that’s right, forgot the refresh
– TotallyUncool