Click here to Skip to main content
15,900,553 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more: 2008 / 3.5

My current application has a splash screen. I also have a user preference for turning it on or off. But I cannot figure out where to put code that handles the on or off feature. I tried putting it in the application events OnStartup but that didn't work. the preference variable is set as expected but when I did this it didn't do anything. The splash screen still ran:

If UserPrefs.ShowSplashOnStartup Then
    Application.SplashScreen = frmAbout
    Me.MinimumSplashScreenDisplayTime = 4000
    Application.SplashScreen = Nothing
End If

I also tried the above code in "Protected Overrides Function OnInitialize" in application events.

Neither of the above had any effect on whether or not the splash screen runs.

How is this sort of thing handled?

TIA for your help.
Nish Nishant 10-Apr-11 10:37am    
Does the If-block evaluate as expected? Perhaps ShowSplashOnStartup is always true.

And do you set Application.SplashScreen elsewhere?

Have a look at this[^] article - this is VS2005 but it should help you out. You could try controlling your startup form through design time properties itself.
Share this answer
All it took was un-setting the splash screen in the application settings screen in development. That must have been overriding my code above.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900