switch (Pattern[i])
{
case \"Blue\":
blueButton.BackColor = Color.LightBlue;
Thread.Sleep(1000);
blu
Thread.Sleep does delay the execution as expected, but you run this code on the same Thread that is printing the UI therefore no Update is visible.
An easy fix for this is Task.Delay (you need to mark the function as async):
case "Blue":
blueButton.BackColor = Color.LightBlue;
await Task.Delay(1000);
blueButton.BackColor = Color.Red;
break;
To mark the function async add the async keyword to the function call
private async Task showPattern(List Pattern)
You should read some basics about windows GUI Thread and async programming.
A very basic explanation of the UI Thread:
When you call Form.Show or Form.ShowDialog the application is starting a so called message loop. This message loop does process mouse and keyboard events of the window shown. This message loop does aswell handle the drawing of the window. Therefore if this thread is locked up, you application becomes unresponsive. A Button Click handler (and all other handlers of you Window) are processed by this same Thread. If you block the execution in one of this handlers (as you did with Thread.Delay) the window is unresponsive (not processing events and not redrawing) in this Time.
To overcome this issue one solution is to work with async and await . This two methods do a lot of compiler magic to make this work as one would expect (check the link for more information, you definitely should!)