Hello Friends,
I am designing a Quiz game, I am now facing a little problem I want to change the background of color of Button for few time. I am using this code:
public void myMethod()
{
if (textbox.Text == "WHAT IS YOUR NAME?")
{
if (btnA == true)
{
Thread.Sleep(3000);
btnAnswerA.Background = Brushes.Green;
Thread.Sleep(3000);
btnAnswerA.Background = Brushes.Black;
}
}
}
private void btnAnswerA_Click(object sender, RoutedEventArgs e)
{
btnA = true;
btnB = false;
btnC = false;
btnD = false;
myMethod();
}
Button Changes it's color but direct From Default to Black, Green color not show.
Please help Thanks.