0

I am using VS2010, C++/CLR WindowsFormsApplication. I want to raise RunWorkerComplete event using BackGroundWorker->OnRunWorkerComple method

backgroundWorker1->RunWorkerAsync();
while (progressBar1->Value != progressBar1->Maximum)
{
    progressBar1->Value = ParentForm1->ImportedData[ComboBoxSelectedItemID]->ProgressStatus; 
}

The thing is that in backgroundworker1 I start some time-consuming operation. And while BGW isBusy progressbar is cheking value of int Variable ProgressStatus. But the problem is that RunWorkerCompleted doesn't raise. So how can I raise it in DoWork?

private: System::Void backgroundWorker1_DoWork(System::Object^  sender, System::ComponentModel::DoWorkEventArgs^  e) 
{
    MyClassObject->TimeConsumingOperation();
    //how to raise RunWorkerCompleted here??? 
}
4

0 回答 0