I want to close and open the same form again. My code is
Form2 fm = new Form2();this.Hide();
fm.ShowDialog(ParentForm);
this.Close();
The problem is that initially form1 which is the main form looses focus. But when i manually focus it on the first call of Form2 the code works perfect from there on. Please help, what is causing my Form1 to loose focus on the first call of Form2
and Form2 comes on top of other windows instead of Form1.