Vb Gangsta Posted September 2, 2003 Posted September 2, 2003 How do you make a spalsh screen in VB.net. I know you used to able to just make a spalsh screen form in VB 6 but I see thats not the case in .net. I made 2 forms, One is my actuall program and the other is what i want to pop up before my program. Do i use the timer or sumthing? Thanks Quote Thanks for any Help!!! -Rob
hog Posted September 2, 2003 Posted September 2, 2003 All my applications use the same approach. Design a splash form with a timer on it. When the time is up it closes the splash form and opens the applications main form. Some may disagree with this approach, but it works fine. I have used it in VBA, VB5, VB6 and now in VB.NET. Quote My website
pjv Posted September 2, 2003 Posted September 2, 2003 I don't mind if an application gives a splash screen while it's loading, but I would get really pissed off with an app that just put it there for a time and did nothing but wait. In fact I would probably remove the app from my system (unless it was really exceptional). You could display the splash screen and do some work in a separate thread, but don't just do it with a timer as very few things are more annoying. I think codeproject has some examples in c# which you could convert. Pete Quote
*Experts* mutant Posted September 2, 2003 *Experts* Posted September 2, 2003 (edited) I would suggest you make your splash screen responsive to a keyboard input or mouse and close it and combine that with a timer. The easiest way to that would be to simply start a message loop for the spalsh screen first and then when it exits , your main form. Edited September 2, 2003 by mutant Quote
hog Posted September 3, 2003 Posted September 3, 2003 I don't mind if an application gives a splash screen while it's loading, but I would get really pissed off with an app that just put it there for a time and did nothing but wait. In fact I would probably remove the app from my system (unless it was really exceptional). Mmm show me an application that starts these days without a splash screen?? Example Nero 5 displays a splash for 9 seconds before doing anything on my laptop. Mmm having to wait a whole 15 seconds for a splash screen to disapear must really be annoying?? Lastly regardless of whether it does anything in the background or not, (mine usaully do), it is not just sitting there doing nothing.........it is doing what a splash screen is supposed to do....inform the user of the product they are loading plus supply some author detail. Lastly lastly....had I not provided such splash screens with the apps I have developed I would not now be in the job that I am doing now as no one would have heard of me if all I did was put author detail in the About menu. Quote My website
Deathjester Posted September 3, 2003 Posted September 3, 2003 Left click on Nero's splash screen ;) /me points to spikey skull head guy Quote
samsmithnz Posted September 3, 2003 Posted September 3, 2003 Lastly regardless of whether it does anything in the background or not, (mine usaully do), it is not just sitting there doing nothing.........it is doing what a splash screen is supposed to do....inform the user of the product they are loading plus supply some author detail. Actually I'd have to slightly disagree with you about this. A Splash screen is supposed to be displayed to the user to indicate that the application hasn't forgotton about them and that processing and startup is continuing. The information on the splash screen really belongs on the About screen (and commonly holds the same information and sometimes even basically IS the same screen). Sorry couldn't help mentioning that. Guess I've been reading Slashdot too much lately. :D Quote Thanks Sam http://www.samsmith.co.nz
pjv Posted September 4, 2003 Posted September 4, 2003 I don't need a splash screen to tell me what app I've just launched (Windows isn't quite *that* bad). Especially one that is going to stop me from doing other things while I wait. Even more so with .NET apps that can take a while to load anyway. I don't mind if it goes away as soon as the program has finished loading -- then any delay is my slow pc ;) Hmmm... might be okay to do splash in unmanaged code and launch the .net app from it. Then remove splash as soon as main form has loaded. Pete Quote
aewarnick Posted September 4, 2003 Posted September 4, 2003 Isn't a timer on a separate thread? So it wouldn't matter if you use the timer to display the splash screen. That way, the Form loads while the timer ticks! It really seems like the only way to do it, without getting too technical that is. Quote C#
*Experts* DiverDan Posted September 4, 2003 *Experts* Posted September 4, 2003 Some of my programs are quite large and thus take sometime to load. Adding another form with a timer will prolong the loading of the now larger program. For these programs I use another small SplashScreen program to open first then load the large program. I think looking at some nice graphic image with legal copyright information and a cool progress bar far is better that looking at, well a blank screen. Quote Member, in good standing, of the elite fraternity of mentally challenged programmers. Dolphins Software
Vb Gangsta Posted September 4, 2003 Author Posted September 4, 2003 where can i get that program? Quote Thanks for any Help!!! -Rob
*Experts* DiverDan Posted September 4, 2003 *Experts* Posted September 4, 2003 ugh, well you write your own splash screen program or form. In its load or activated event load the main program or form first. Set a timer for a second or two longer than it takes the program to load, add some cool looking graphics, maybe a progress bar, some copyright legalize, maybe a little fading and you're done. Quote Member, in good standing, of the elite fraternity of mentally challenged programmers. Dolphins Software
dsgreen57 Posted September 4, 2003 Posted September 4, 2003 the following is a url for a code download, which includes a complete splash screen example in VB.NET it loads a splash screen and starts the main application in a seperate thread http://support.apress.com/signup.asp?bP=/books.asp?s=0% Quote
hog Posted September 4, 2003 Posted September 4, 2003 OK to clarify:) All the apps I have produced to date use a splash form with a timer to display an identical form as displayed on the about menu. Where there is some background procesing going on which would normally delay the app from starting then I do not use a timer as the delay would be too long, (at least we agree on that:) ). As I previously stated I use the splash form basically to advertise to users who it was who wrote the app and display a the apps logo. You cannot be sure every user will bother to look at the about option so in these cases the author remains unknown. If I didn't use this approach then I would not be in the job I'm in now as it was directly though this that my skill was noticed. Worse case in all my apps is a delay of 15 seconds and that is without a timer as it connects via odbc to various remote tables so is unavoidable. Personnaly 15 seconds is a piss in the ocean! But I accept we are all different and thus we can happily agree to disagree:) Quote My website
pjv Posted September 4, 2003 Posted September 4, 2003 But is that 15 seconds where I can't use my computer at all (due to a big splash screen in the way)? If the splash screen can be closed with a click, or doesn't stay on top then I suppose that's not so bad. Lets be perfectly clear with this, though: A splash screen is of *no* benefit to the user whatsoever. It is simply another form of showing off, attempting to make an app look professional (which is a valid goal I suppose). But there is nothing in it for the user, there's nothing there they can't find if they look elsewhere. DiverDan: If your splash screen app is written with windows forms, how long does it take to load (after you boot windows -- not a fair test if it's already partly in memory)? I'm thinking of making a splash screen prog that will stay up only until the app has finished loading (using remoting with the app). This would also allow us to check for single instance, etc in the splash app rather than the main app. If windows forms is too slow, I might try it with unmanaged c++. Not too sure how to communicate with the actual app in this case, though. Pete Quote
*Experts* DiverDan Posted September 4, 2003 *Experts* Posted September 4, 2003 Hi Pete, 9 seconds to load the main program from a cold boot. The main point of my splash screens is to display copyright and disclaimer information. If the program took 1 second to load, I would still need the splash screen. Some lawyers really insist on too much cra#**#!!! Sorry for the lawyer shot, but I wish I could name names. Dan Quote Member, in good standing, of the elite fraternity of mentally challenged programmers. Dolphins Software
Leaders John Posted September 4, 2003 Leaders Posted September 4, 2003 Using a timer on a splash screen is perfectly valid option if done for the right purposes. Sometimes shareware apps use them as a minor annoyance to get you to buy the full version and they plainly state that on the splash screen. It can also be perfectly valid if you are developing a freeware app, and want people to know who you are, I assume this is what hog did. If the program is a professional app, with no free trial or any of that sort of thing, then IMHO it should only be used so that the user can see that the program didn't freeze while it is loading the application in the background. Just my 2 cents ;) Quote "These Patriot playoff wins are like Ray Charles songs, Nantucket sunsets, and hot fudge sundaes. Each one is better than the last." - Dan Shaughnessy
hog Posted September 5, 2003 Posted September 5, 2003 Pete, I accept your opinion on the topic but you must also accept other have a perfectly valid opinion also. Orbity......well said :) Quote My website
pjv Posted September 5, 2003 Posted September 5, 2003 Fair enough. Orbity: So long as the shareware splash screen can be removed once you register (like in TextPad). For freeware apps.. it's still not really there for the benefit of the user (although I'll grant you that it's acceptable -- basically what I said earlier) :) . Just so long as people realise that an app that takes a while to load (winforms) *and* shows a splash screen for a fixed time will have fewer users than one where it is optional/short/timed to app completion. -- Pete Quote
hog Posted September 5, 2003 Posted September 5, 2003 Pete, you make me laugh.....you just gotta have the last word! Go on then I'll let ya:):):) Quote My website
pjv Posted September 5, 2003 Posted September 5, 2003 Yeah, it's a real character flaw ;) -- Pete Quote
gearbolt Posted September 8, 2003 Posted September 8, 2003 Hey dsgreen57 what was the name of that book that had the splash screen code. The link does not work. Quote
bdimon Posted September 13, 2006 Posted September 13, 2006 Another splash screen in VB.NET 2003 Why display a splash screen? In my case, I have to install a second copy of the code for beta testing. My users are doing the test. The customer says to display a splash screen so they know that they started the new beta program instead of the old production code. I want to display the screen for five seconds but not hold up the program load. I use a sub main in a VB module to start the splash form and the main form. The splash form is a FRIEND so that the main form can close it. At the end of the main form's load event, it subtracts out the time that has already passed and starts a timer with the difference. Here's the code: Module Main Friend Splash As New SplashIntro 'Splash Screen Friend SplashStartTime As Date 'Splash display time Sub main() With Splash .Show() .Refresh() 'My labels flickered without this refresh End With SplashStartTime = Now 'Count 5 seconds from now. Trace.WriteLine(SplashStartTime.ToLongTimeString) Application.DoEvents() 'Process event queue Dim MainProgram As New MainForm Application.Run(MainProgram) 'Use run so that this form can close Splash End Sub End Module The MainForm has a timer control on the form named "Splashtimer." Here's the code I tacked onto the end of the long form load event: Trace.Write("Timer interval =") 'We want the splash screen up for 5 seconds. Subtract the time it took 'to get to this point. Dim TimerInterval As Integer = (5 - DateDiff(DateInterval.Second, SplashStartTime, Now)) * 1000 'Just in case it took too long. Handle errors so they cannot hurt you. If TimerInterval <= 0 Then TimerInterval = 500 'Should never be true Trace.WriteLine(TimerInterval.ToString) With SplashTimer .Interval = TimerInterval 'Time left for splash screen .Start() 'Start timer End With End Sub Private Sub SplashTimer_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles SplashTimer.Tick Trace.WriteLine(Now.ToLongTimeString) SplashTimer.Stop() 'We only run this once Splash.Close() 'Close the form End Sub The program load takes about two seconds out of the five seconds that the splash screen is displayed. The main program is usable in the other three seconds that the splash is displayed. Hope this helps Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.