how to focus a form in my case.
hi,
this is my code.
1 btn1.Text = "abc";
2 btn2.Text = "xyz";
3 new IdPwd().ShowDialog();
4 this.txttransferno.Focus();
on line# 3 a new form is opened. in this new form's Exit button i m using
this.close();
the porblem is that after the closing of new form it's parent Form from it was called is not appearing/focused
i.e. line# 4 seems useless.
however if i use a message box after line#3 i.e.
3 new IdPwd().ShowDialog();
4 MessageBox.Show("Closed"); // this MessageBox must be replaced by a mechanism that foucuses this form.
5 this.txttransferno.Focus();
now the parent form is getting focued after close of new from i.e. line#5 is now valid.
How can i get focus parent form without using a MessageBox at line# 4.
Please help.
Arif.
|