How to update the progress bar through Backgroundworker in C#?
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();
backgroundWorker1.DoWork += new DoWorkEventHandler(delegate(object o,
DoWorkEventArgs args)
{
GenerateExcel(FileName, 1);
});
backgroundWorker1.RunWorkerAsync();
Thanks
No comments:
Post a Comment