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?
Game ProgrammingMicrosoft Legacy OS

Avatar of undefined
Last Comment
alStatus

8/22/2022 - Mon
arnold

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?
alStatus

ASKER
No I am not sure.
ASKER CERTIFIED SOLUTION
Mike Tomlinson

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
alStatus

ASKER
Yes, that was the ticket. Needed to update the GUI.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck