i need to run a time consuming process in backgroundworker and in that process i need to open a window too. All work good but when i call a UI in that process, it not allow me to work in that new window it just show waiting and when i cancel the backgroundworker process it not cancel either although i enable workersupportcancel. Here is my code
private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
{
BackgroundWorker worker = sender as BackgroundWorker;
runCheck();
}
private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
if (e.Error != null)
{
MessageBox.Show(e.Error.Message);
}
}
private void newBtncheck_Click(object sender, RibbonControlEventArgs e)
{
backgroundWorker1.RunWorkerAsync();
}
private void newBtncheck_Click(object sender, RibbonControlEventArgs e)
{
backgroundWorker1.RunWorkerAsync();
}
private void btnStop_Click(object sender, RibbonControlEventArgs e)
{
this.backgroundWorker1.CancelAsync();
}