MsgBox minimised in .EXE but not in Debug

Cat-a-tonic

New member
Joined
Feb 25, 2012
Messages
3
Programming Experience
3-5
I've written a program to multiplex serial port input streams as a first VB.Net project. All working fine but has one anomaly which I can't crack.

When I run it in Debug mode, the program has a SplashScreen at start up then a Yes/No MsgBox pops up over it as expected. Clicking the Yes or No then brings up the main form after the SplashScreen closes. This is what I expect.

However, when I publish the solution and run the .EXE it runs as follows: the SplashScreen appears but the MsgBox doesn't popup. The MSgBox is minimised and doesn't popup until I click it. Then I can click Yes or No and the program continues as above.

Can anybody explain why this is happening and what I can do to ensure that the MsgBox behaves the save in the .EXE as it does under Debug?
 
CORRECTION: The MsgBox hasn't been minimised - it is hidden behind the Splashscreen in the published .EXE but pops up over the SplashScreen when running in Debug (which is what I want). Same question - "Why and what can I do about it"?
 
Why: Splash screen is asynchronous, so what happens when in relation to the main thread is undetermined. There are also differences in execution speed between debug and release that can affect this.
How: You can for example from the application Startup event add a handler for the splash screens Shown event, and show the MessageBox from that handler.
 
Back
Top