I would like to use a BackgroundWorker. Because we have a loop that large in your WinForm it
will block and your app will look like it has hanged.Now we are using BackgroundWorker.ReportProgress()to see how to report progress back to the UI thread and progress bar has been
changed.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
I would like to use a BackgroundWorker. Because we have a loop that large in your WinForm it will block and your app will look like it has hanged.Now we are using BackgroundWorker.ReportProgress() to see how to report progress back to the UI thread and progress bar has been changed.
Output:
you can also set the property of Progress bar, such like this:
progressbar1.Minimum=0;
progressbar1.Minimum=100; etc.