Progress bars are useful indicators of the status of a background task, showing an incrementally filled portion of the bar relative to the progress. They are frequently used in long-running operations, so it is common to connect them with the threads that execute these tasks to provide visual feedback to end users.
Connecting threads with a progress bar
Getting ready
Our sample application will consist of a horizontal progress bar that will increment a fixed amount of progress once the user clicks on the Start button:
How to do it...
To simulate the execution of a background...