We help IT Professionals succeed at work.

Splash Screen in VB.net project causes app to loose focus.

Medium Priority
1,474 Views
Last Modified: 2013-11-26
I have this annoying problem in VB.net im hoping someone else has seen/solved.

I created a splash screen for my application using the Splash screen template avalable in vb.net 2005 and set the Splash screen property in the project to the form.

Now when you start the compiled app (this doesnot happen when you run the app in dev environment)
the focus switchs away from the app to the next window in the task order. (if nothing else is open focus switches to the desktop)  

Anyone have any ideas?
Comment
Watch Question

Jorge PaulinoIT Pro/Developer
CERTIFIED EXPERT
Top Expert 2008

Commented:
How do you call the other form in the end on the events/timer ?

Application.Run(frm) ?
Jorge PaulinoIT Pro/Developer
CERTIFIED EXPERT
Top Expert 2008

Commented:
Well try this method to use a splash screen:

1 - Select in My Project - StartUp Form the main form (second you want to see after the splash screen)
2 - Click in the View Application Events from Application Tab. You will see the Namespace My.
3 - Choose in the comboboxes the MyApplications Events - StartUp. You will see Private Sub MyMyApplication_Startup(..) Handles Me.StartUp
4 - Add this code (with the necessary changes)

Dim frm As New frmStartUp
frm.ShowDialog()

jpaulino

Commented:
I started a new Windows Application.  Added a SplashScreen.  Set the SplashScreen to SplashScreen1.
I was unable to duplicate you results.  The SplashScreen1 retained the focus in both debug and release versions.  Have you done anything besides the three steps I did?

Author

Commented:
This only happens on system where visual studio is NOT installed. If vs is on the system it works fine
Commented:
I also had the same problem and i found the following under http://www.thescripts.com/forum/thread638041.html

They think that this problem is caused by the internal implementation of splash
screen.

They describe here a workaround to display the splashscreen in the application's Startup event handler and close it later in the main form's Load event handler. For me this workaround was okay and i have used it.