I need my program to "stop" as the timer is running and when the timer returns true i need it to continue what it was doing.

Sleep:

void iUpdateStatus()
        {
            bComplete = true;
            //IDC_Status.Text = IDC_Status.Text + "\r\n" + DateTime.Now.ToString();
        }

bool sSleep()
        {
            System.Timers.Timer myTimer = new System.Timers.Timer();
            myTimer.Elapsed += new ElapsedEventHandler(DisplayTimeEvent);
            myTimer.Interval = 15000;
            myTimer.Start();
            if (bComplete)
            {
                bComplete = false;
                myTimer.Stop();
                return true;
            }
            return false;
        }

        void DisplayTimeEvent(object source, ElapsedEventArgs e)
        {
            if(IDC_Status.InvokeRequired)
            {
                IDC_Status.Invoke(new MethodInvoker(iUpdateStatus));
            }
        }

example of the posting

LoadText(Zone);
                PostTopic(3, "[RS.com] Zone Alarm Keygen", Post);
                //Sleep Here once timer has completed go to next lot
                
                LoadText(Adobe);
                PostTopic(3, "[RS.com] All Adobe Keygens", Post);
                //Sleep Here once timer has completed go to next lot

                LoadText(Alcohol);
                PostTopic(3, "[RS.com] Alcohol 120% v1.9", Post);
                //Sleep Here once timer has completed go to next lot

                LoadText(CleanMyPC);
                PostTopic(3, "[RS.com] CleanMyPC", Post);
                //Sleep Here once timer has completed go to next lot

                LoadText(DVDFab);
                PostTopic(3, "[RS.com] DVDFab 5.1 Final", Post);
                //Sleep Here once timer has completed go to next lot

Simply put your current thread in sleep mode. Fairly easy to do with 1 line of code.

System.Threading.Thread.Sleep(int milliseconds);

Simply put your current thread in sleep mode. Fairly easy to do with 1 line of code.

System.Threading.Thread.Sleep(int milliseconds);

i dont want to pause the main thread.

I need my program to "stop" as the timer is running

imho that is what you asked and iDeveloper gave you a correct answer.

If you have something that needs to pause and continue you shouldnt be using the mainthread for it. Thats what threads were invented for.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.