Search code examples
c#multithreadingbackgroundworker

I need to pause my progress bar for a couple of seconds before it goes back to null


I need to pause my progress bar for a couple of seconds before it goes back to null.

I am using Background worker.

The completion in the progress bar is not noticeable, i want to give the user time to notice the job done.

I don't want to use "Thread.sleep" cause it will make my program slow. I think that freezing the ui might help as all my work is done in background thread, but i have no idea how to do that.


Solution

  • I have eventually solved the problem. Though I didn't actually freeze the UI nor did i use thread.sleep. I went into the last sub-function and reported the progress as 100 there. So when it completes the function the progress bar also reaches 100.but it takes a couple of milliseconds to come back to dowork function and then to runworkercompleted. It gives a window for the user to notice it complete. Thanks everyone!

    I appreciate all your efforts and advices.