Changing colors of buttons on form after set delay

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • burtski99
    New Member
    • Feb 2008
    • 2

    Changing colors of buttons on form after set delay

    ...with a simple problem. I have 2 buttons on my form, button1 and button2. I want the following sequence:-

    1) button1 changes colour to red
    2) wait 2 seconds
    3) button1 changes back to gray and button2 changes to red
    4) wait 2 seconds
    5) button2 changes back to gray and button1 changes to red.

    Please help me or I'll be forced to eat more chocolate orange biscuits.
  • sicarie
    Recognized Expert Specialist
    • Nov 2006
    • 4677

    #2
    So what do you have on this? What have you tried?

    Comment

    • burtski99
      New Member
      • Feb 2008
      • 2

      #3
      Hey, thanks for your reply - I wasn't expecting one this quick.

      I've tried system.threadin g.thread.sleep (2000).

      I also tried a ridiculous "while" statement which took the current datetime seconds value, then populated int1 with it. I populated int2 with int1 + 2 (subject to an 'if' which said that if int1 is > 57, subtract 60 from it) I then had a "while (int1<int2) {int1 = System.DateTime .Now.second}.

      Both of them compiled, but I ended up with the final result ie button1 red. Button2 didn't even blink a little bit.

      Comment

      Working...