Executing a time-consuming process in an independent thread allows us to work concurrently while showing its progress. One of the advantages of doing this is the possibility of allowing the user to go on using the controls in the graphical user interface without the restrictions of single-threaded applications. For example, perhaps he or she wants to cancel the CodeBreaking process instead of letting it finish.
BackgroundWorker component simplifies the task of canceling the execution of the code running in the thread it creates without a lot of programming effort.
To do this, we must assign the
true value to the
WorkerSupportsCancellation property of
BackgroundWorker. It is a
bool value and tells whether the ...