Is background worker a thread? When should I use it?
Yes, it is basically like a thread, but with extra functionality (events to notify you of progress and when it finishes).
You should use it whenever you need to execute something that might take a while (e.g. a calculation, file or database reading/writing, web requests, etc.) and you don’t want the GUI to appear unresponsive while it is happening:
The BackgroundWorker class allows you to run an operation on a separate, dedicated thread. Time-consuming operations like downloads and database transactions can cause your user interface (UI) to seem as though it has stopped responding while they are running. When you want a responsive UI and you are faced with long delays associated with such operations, the BackgroundWorker class provides a convenient solution.
Read How to: Run an Operation in the Background for an introduction.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With