Link to home
Start Free TrialLog in
Avatar of alStatus
alStatus

asked on

How do I put pauses between texts that will be added to labels to Start the race?

private void go_Click(object sender, EventArgs e)
        {
            double tickspersecond;
            int intervalbetweenticks;
            tickspersecond = Double.Parse(inputSpeed.Text);
            intervalbetweenticks = (int)Math.Round(1000.0 / tickspersecond);
            timer1.Interval = intervalbetweenticks;            
            go.Text = "Go";
            Application.DoEvents();
            startRemarks1.Text = "On your mark";
            Thread.Sleep(1000);                                                  //  <--- This area is what im refering
            startRemarks2.Text = "Get set";
            Thread.Sleep(1000);
            startRemarks3.Text = "Bang!!!!, and they're off.";
            timer1.Start();
        }

Not sure why between the Thread.Sleep() the program will not wait a second?
Avatar of arnold
arnold
Flag of United States of America image

increase the value by 60 times for 60 seconds, if you have a threaded, are you sure the right thread is being put to sleep?
Avatar of alStatus
alStatus

ASKER

No I am not sure.
ASKER CERTIFIED SOLUTION
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yes, that was the ticket. Needed to update the GUI.