Windows Forms Topics include: windows forms, controls, components and designers

Go Back  Xtreme .NET Talk > .NET > Windows Forms > VS2005: how to display splash screen for few seconds


Reply
 
Thread Tools Display Modes
  #1  
Old 04-26-2006, 12:02 PM
kaisersoze kaisersoze is offline
Centurion
 
Join Date: Aug 2003
Posts: 152
kaisersoze is on a distinguished road
Default VS2005: how to display splash screen for few seconds



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?
__________________
Note: I think as a programmer not as a human, so use my answer at your will
Reply With Quote
  #2  
Old 04-26-2006, 05:45 PM
snarfblam's Avatar
snarfblam snarfblam is offline
Ultimate Contributor

Preferred language:
C#, VB
 
Join Date: Jun 2003
Location: USA
Posts: 2,097
snarfblam will become famous soon enough
Default

What is the specific issue? Why does the same approach not work?
__________________
e
Reply With Quote
  #3  
Old 04-27-2006, 09:37 AM
mskeel's Avatar
mskeel mskeel is offline
Senior Contributor

Preferred language:
C#, VB.Net, F#
 
Join Date: Oct 2003
Posts: 913
mskeel is on a distinguished road
Default

Are you using VB or C#? Splash screen approaches are different for each language in VS2005.
Reply With Quote
  #4  
Old 04-27-2006, 10:02 AM
kaisersoze kaisersoze is offline
Centurion
 
Join Date: Aug 2003
Posts: 152
kaisersoze is on a distinguished road
Default

tell me in VB.net and then in C#
__________________
Note: I think as a programmer not as a human, so use my answer at your will
Reply With Quote
  #5  
Old 04-27-2006, 10:20 AM
mskeel's Avatar
mskeel mskeel is offline
Senior Contributor

Preferred language:
C#, VB.Net, F#
 
Join Date: Oct 2003
Posts: 913
mskeel is on a distinguished road
Default

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.
Reply With Quote
  #6  
Old 08-25-2006, 01:13 AM
Woodster Woodster is offline
Newcomer
 
Join Date: May 2006
Posts: 7
Woodster is on a distinguished road
Default

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
Reply With Quote
  #7  
Old 08-25-2006, 06:27 PM
snarfblam's Avatar
snarfblam snarfblam is offline
Ultimate Contributor

Preferred language:
C#, VB
 
Join Date: Jun 2003
Location: USA
Posts: 2,097
snarfblam will become famous soon enough
Default

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:
Code:
[COLOR=Blue]My[/COLOR].Application.SplashScreen.Close()
__________________
e
Reply With Quote
  #8  
Old 08-27-2006, 06:26 AM
Woodster Woodster is offline
Newcomer
 
Join Date: May 2006
Posts: 7
Woodster is on a distinguished road
Default

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
Reply With Quote
  #9  
Old 08-27-2006, 09:14 PM
snarfblam's Avatar
snarfblam snarfblam is offline
Ultimate Contributor

Preferred language:
C#, VB
 
Join Date: Jun 2003
Location: USA
Posts: 2,097
snarfblam will become famous soon enough
Default

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.
__________________
e
Reply With Quote
  #10  
Old 08-28-2006, 12:36 AM
Woodster Woodster is offline
Newcomer
 
Join Date: May 2006
Posts: 7
Woodster is on a distinguished road
Default

Thanks marble_eater, will certainly check all code both open and hidden.

Rock ON!
Woodster
Reply With Quote
  #11  
Old 08-28-2006, 09:31 AM
mskeel's Avatar
mskeel mskeel is offline
Senior Contributor

Preferred language:
C#, VB.Net, F#
 
Join Date: Oct 2003
Posts: 913
mskeel is on a distinguished road
Default

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.
Reply With Quote
  #12  
Old 08-30-2006, 01:30 AM
Woodster Woodster is offline
Newcomer
 
Join Date: May 2006
Posts: 7
Woodster is on a distinguished road
Default 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
Reply With Quote
  #13  
Old 10-23-2008, 02:45 AM
UdayKumarB UdayKumarB is offline
Newcomer
 
Join Date: Oct 2008
Posts: 1
UdayKumarB is on a distinguished road
Default Re: VS2005: how to display splash screen for few seconds

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.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Display Seconds (double) as HH:MM:SS (string?) [C#] Shaitan00 General 1 09-11-2005 03:54 PM
Display loading status on splash screen BAMacek Windows Forms 1 04-01-2004 07:37 PM
Splash screen Darc General 2 09-27-2003 01:28 PM
Splash Screen fkheng Windows Forms 7 05-22-2003 08:17 AM
splash screen label delay on display bwells Windows Forms 1 04-29-2003 09:44 AM

Advertisement:







Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe