Hi Ian, Thanks for your great advice. I tried BackGroundWorker component also. However, I am getting same result - Form2 get hanged. Thereafter, I tried some stupid stuff and it worked. I only copied form2_load code in public method (BuzyOperation) and called BuzyOperation() replacing it with frm2.show()
Form2 frm2;
private void backgroundWorker1\_DoWork(object sender, DoWorkEventArgs e)
{
frm2 = new Form2();
frm2.BuzyOperation(); //Earlier it was frm2.Show().
}
After completing BuzyOperation(), below code will execute which will only show form2 with Job Done msg.
private void backgroundWorker1\_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
frm2.Show();//this will call frm2\_load event, which is now empty. I copied all code to BuzyOperation()
MessageBox.Show("Job done!");
}
I found the result as success, Now form2 is not getting hanged :thumbsup:. I don't know what is going inside frm2.Show() (in our earlier scenerio), but i would like to know from you. :confused: Pls. let me know.
Thanks in advance, Chintan.