Zorder and splash screen

A

Andy

Hi,

I have a form which is a splash screen. A static method is used by my
main program startup to show the form, which creates the form on a
seperate thread and shows it using Application.Run( splash ).

The problem is when my main form shows and the splash hides, the main
form ends up behind any other window display (such as my web browser or
explorer windows).

I've read this is because the first message pump that ends causes the
application to deactivate, but I haven't been able to find a solution
to this.

I had replaced Application.Run with this loop:

while ( !shouldClose ) {
Application.DoEvents();
}

Where should close is a boolean that indicates if the form should close
or not. (Which is set by another static method called from the main
thread).

Any ideas?
 
G

Guest

Andy said:
The problem is when my main form shows and the splash hides, the main
form ends up behind any other window display (such as my web browser or
explorer windows).

Try showing and activating the main form before hiding the splash page.
When the active window is hidden, the window manager finds a new window to
make active. If there are no eligible windows in your process then it will
pick one from another process.
 
T

ThunderMusic

hi,
Why don't you use this :

YourSplash frm = new YourSplash();
frm.Show();
Application.Run();

this way, everything runs as expected... as soon as their will be no other
loaded forms or process, the application will end... I just tested it and
it works real fine for your kind of situation...

I hope it helps...

ThunderMusic
 
T

ThunderMusic

oups, sorry, I must correct what I just said... you will have to manually
terminate the message pump with Application.Exit() when you want to close
your app definitly...

I hope it helps

ThunderMusic
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top