I'm trying to make a panel 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 crashes every time it arrives in this part, can someone tell me why?