//funcation called inside DoWork of a backgroundworker public bool ShowSupportLogon() { bool erResult = false; System.Threading.Thread.Sleep(5000);//Time-consuming tasks //passing control to foreground/main thread to show the form this.Invoke((MethodInvoker)delegate() { DialogResult dr = er.ShowDialog();//er is the object of another form(global variable) if (dr == DialogResult.OK) { erResult = true; } else { erResult = false; } }); System.Threading.Thread.Sleep(2000);//Time-consuming tasks return erResult; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)