The control has three events: dowork, progresschanged, and runworkercompleted. Calling the runworkerasync method in the program starts dowork event processing, when you call the reportprogress method, the event processing of the progresschanged event is started. When the dowork event is processed, the runworkercompleted event is triggered. Make sure that you do not operate any user interface objects in the dowork event handler. You should use the progresschanged and runworkercompleted events to communicate with the user interface. The progresschanged event occurs when reportprogress is called during the processing of the dowork event. Void backgroundworker1_progresschanged (Object ^ sender, progresschangedeventargs ^ e): void reportprogress (INT percentprogress) void reportprogress (INT percentprogress, object ^ userstate) the second parameter E of the progresschanged event handler has a progresspercentage attribute, which is provided by the first parameter percentprogress of reportprogress. This parameter is generally used to report the progress of the background operation, and then the progress information is obtained using the progresspercentage attribute of the second parameter E of progresschanged. If you want to pass more information, you can use the second overload of reportprogress. Its second parameter userstate will be passed to the userstate attribute of parameter E of the progresschanged event.
Considerations for using the backgroundworker Control