Hi,
I'm a novice in C#. I wrote a program to export data from datagridview. While exporting, a pop-up window with a progress bar will show the progress of file being written. On the main form, I wrote:
BackgroundWorker bgw = new BackgroundWorker();
bgw.DoWork += delegate
{
//Code for exporting data
};
bgw.RunWorkerAsync();
FrmProgress progress = new FrmProgress();
progress.Show();
bgw.RunWorkerCompleted += delegate
{
progress.Close();
};
The pop-up window showed up while exporting, but the progressbar on the modal window is not updated. I tried bgw.ReportProgress but getting an error. Probably I didn't use it correctly. How do I update the progressbar in modal window? Can anyone please help me with this?
Thanks in advance!
Bechir BejaouiPosted Dec 22, 2008, 7:01 AM
first you set your backgroundworker WorkerReportsProgress property to true to enable worker report its progress
arun dPosted Apr 20, 2017, 12:54 PM
mel CPosted Jan 5, 2009, 4:42 AM
You are absolutely right. I didn't pass the value ated and called the eventhandler that's why the progress bar will not upd.
Thanks for your great answer! =D
mel CPosted Jan 5, 2009, 4:38 AM
Hi Jan,
Thanks for asking. I'd solved the problem.
Jan MontanoPosted Dec 22, 2008, 1:51 AM
Hi Mel,
Have you already solved your problem?
Regards,
jan