the Form does not displayed as Dialog inside backgroundworker?
Here is my code:
//From Form1
private void backgroundWorkerResult_DoWork(object sender, DoWorkEventArgs e)
{
//do something here
backgroundWorkerResult.ReportProgress(100);
frmMessageBox frmMsgBox = new frmMessageBox();
frmMsgBox.ShowDialog();
}
Even though i already showed the frmMsgBox
as a dialog i Can still click the Form1
that supposed to be not? how can fix this?
I created a simple code sample that you can use to understand how the background worker works. Copy the code to a test form and add the following controls
Basically you should display the results in the RunWorkerCompleted event
Edited as per comment by the OP
In the DoWork event, set your string as follows
and in the RunWorkerCompleted event
NOTE: e.Result is an object so you can even set your custom classes with multiple properties in it.