How to update the progress bar through Backgroundworker in C#? [duplicate]
问题 This question already has answers here : c# winform background worker and progress bar (2 answers) Closed 6 years ago . I have a Backgrounder worker which generates the Excel file through the C# function GenerateExcel() . Within the GenerateExcel() function, I am using the progressbar to update the status. However, it is throwing an exception, that I cannot modify the GUI control. Any idea what could be the error in the code ? BackgroundWorker backgroundWorker1 = new BackgroundWorker();