This is going to be difficult without pictures, I suspect...
The BackgroundWorker operates on a different thread to the UI, and there is a good chance that it can operate on a different core as well, so it can operate and run while your UI is operating.
So let's look at the sequence of events generated by the BGW:
Progress(98%)
Progress(99%)
Progress(100%)
WorkerFinished
These events cause an Event to be generated in the UI thread, which responds: in the case of the Progress Event, it sets a new value into the Progress control and that causes another event on the UI thread - a Paint due to the update doing an Invalidate on the control. Paint is a low priority event anyway, and won't be issued immediately, so if the worker finishes before the paint is actioned, the BGW has already placed the WorkerFinished Event into the UI queue and it gets executed next, before the Paint is even queued, much less executed!
Since a MessageBox is a modal control, it is quite possible that the actual update of the on-screen progress will not be done until after the user has pressed the "OK" button!
If you want to get this to do exactly what you want, then you need to "pause" the BGW for a moment to allow the Progress updates to finish before you terminate the thread:
Sleep(500);
Should do it. :luagh: