VS2005: how to display splash screen for few seconds

kaisersoze

Centurion
Joined
Aug 27, 2003
Messages
152
In VS2003, in sub main I load Splash screen and in the back grourd I do many processes shawing the status to the user in the splash screen.

I VS2005, I a, not able to call sub main and do the same i did in 2003. can some one help what am i missing?
 
Are you using VB or C#? Splash screen approaches are different for each language in VS2005.
 
In VB.Net 2005 it's really easy. All you have to do is declare a windows form (a generic splash screen is even a type of file you can add now). Then, double click on "My Project" in the solution explorer for the project you want the splash screen for. On the "Application" tab, there is a drop down box at the bottom of the page titled splash screen. Select the form you want to use as a splash screen from the drop down box and you'll be good to go. If I recall correctly, you'll be able to access that splash screen in code through the My namespace (My.Application.SplashScreen). It's really quick and very easy, though I have noticed difficulties with windows 2000.

In C#, you will do it the old way, as was done in VS2003.
 
Dear mskeel

Followed the instructions to a tee for the current project I'm on and the splash screen shows....only problem is, it doesn't close and remains shown throughtout the length of the application's run. Closing the application also closes the splash screen. I checked the Application.MinimumSplashScreenDisplayTime and it was set to 2000.

Any ideas would be appreciated.

Rock ON!
Woodster :cool:
 
Why not explicitly close it yourself? I don't have any experience with the "Application Framework" feature, but you might be required to run this line of code yourself:
Visual Basic:
[COLOR=Blue]My[/COLOR].Application.SplashScreen.Close()
 
Thanks, marble_eater, for your thoughts. VS2005 help states:

"The My.Application.MinimumSplashScreenDisplayTime property allows you to specify the minimum length of time you want the application's splash screen to be displayed. If the main form finishes initializing in less time than what is specified by this property, the splash screen remains until the requested amount of time passes, at which time the main form is displayed. If your application takes longer to start, the splash screen is closed once the main form becomes active."

From this I gather that it is not necessary to explicitly close the splashscreen. I cannot think why the splashscreen for my project continues to display throughout the length of the app's run.

Isn't programming fun?

Rock ON!
Woodster :cool:
 
You don't explicitly show the spashscreen yourself, do you? Assuming the answer is no, maybe you should carefully check any code in the splash screen (consider checking designer code too, just to be sure) and make sure there is no code that would prevent the form from closing.
 
The splash screen features for VB8 are new and could easily be buggy. Case in point, it doesn't work on a Windows 2000 machine. If it's not working exactly as documented, I wouldn't get too bent out of shape over it. Check to make sure, as marble_eater has already suggested that you are using it as directed. If you still have the problem, there is nothing wrong with hiding/closing it manually yourself even though you aren't supposed to have to do that.

There could be any number of things going wrong. The important thing is that you get it to work the way you want it to work and that no one discovers the hacks you had to put in place to make it work.
 
VS2005: how to display splash screen for few seconds (RESOLVED)

How right you are, mskeel! The splashscreen works fine in XP and goes all wonky in W2k. Will take your "don't worry about the hacks you have to do to get what you want" advice to heart.

Thanks all for your thoughts. Can we considered it resolved?

Rock ON!
Woodster :cool:
 
at start of the application THe splash screen appears only for few seconds,

i am invoice of VB.NET 2005 tried this line of code
//FormName_Load
My.Application.MinimumSplashScreenDisplayTime = "2000"

tried diffrent numbers insted of '2000' but cant see change,.. please help i want this screen to appear for few more seconds to end user. :confused:
 
Back
Top