Reputation: 2255
I have form that takes few seconds to load and open, i need the other form (Form Represents "Please Wait ...") to be focused and stable while opening the main form.
I close the please wait form after 2 secs BUT it doesn't take the general focus.
This is the code i use to open the two forms :
LoadingPage load = new LoadingPage();
load.Show();
load.TopMost = true;
//
string contractorType = "importer";
//
customersPage obj = new customersPage(this, contractorType);
obj.MdiParent = homeObj;
obj.Show();
Please, any idea ?
thanks,
Upvotes: 0
Views: 98
Reputation: 6060
That may be behaving funny because customerPage
is an MDI child. Have you considered making LoadingPage
modal? You would of course have to load your customerPage
from events within LoadingPage
(e.g. Form_Load
or a 100ms timer callback, etc.,) because the call to ShowModal
will block until LoadingPage
closes.
The idea is that if LoadingPage
is modal, then no other window in the same thread can take focus from it.
Upvotes: 1