fantasma62 Posted November 25, 2002 Posted November 25, 2002 I promise this is it, I have bothered you enough.... I have set up a Splash Screen so that when the 5 second timer ends, the Parent form will be displayed..... I have set up a module to set off the Splash Form and I have put in a timer in the frmSplashScreen. However, once the 5 seconds have elapsed, the program stops running and doesn't display the frmMdiParent........ ??? Quote
*Gurus* divil Posted November 25, 2002 *Gurus* Posted November 25, 2002 You don't have to leave us alone, it's kinda what we're here for :) For something like this, you'll want to modify your project startup object. By default your program message loop is set up for one form, but if you want to hide and show another before your main one is displayed, you'll need to change it a little. Go in to your project properties (right click on the project, select properties) and where it says Startup object, select Sub Main. Then create yourself a new class (or you can use an existing one) and make the following method: Public Shared Sub Main() Dim x As Form2 = New Form2() x.Show() Application.Run() End Sub Replacing Form2 with the name of your splash screen, obviously. I'm assuming there is a timer on your splash screen form which, when it fires, will close and dispose of itself and open a new main form. The only other change you'll need to make is to explicitly shut down your program's message loop. To do this, catch the Closed event of your main form, and in it put this line: Application.Exit() Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
fantasma62 Posted November 25, 2002 Author Posted November 25, 2002 One thing, though, should I create this SubMain in my Startup module or in the Splash Screen? Quote
fantasma62 Posted November 25, 2002 Author Posted November 25, 2002 Hmmm, I don't see the closed event in my main form. I imagine you mean the frmMdiParent form.....Again, sorry for my lack of knowledge, but I am a beginner....I already placed the SubMain in the frmSplashScreen.... Quote
*Gurus* divil Posted November 25, 2002 *Gurus* Posted November 25, 2002 I said you could put the Sub Main wherever you like, it doesn't matter. In the code for your main form, select Base Class Events from the left-hand dropdown at the top of the editor, and then Closed from the right... Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
fantasma62 Posted November 25, 2002 Author Posted November 25, 2002 sorry, as I finished writing my last post, I got what you wanted me to do..... What's happening is that when the splash screen's timer ends, the Parent form, which is the one that I want to display, flashes and the application closes..... As you can plainly see, my instructor doesn't exactly instruct.....Thus, I don't know things that I am supposed to know.... Quote
*Gurus* divil Posted November 25, 2002 *Gurus* Posted November 25, 2002 I suggest you buy a book. In this thread I have given you ample information and walked you through the process of doing what you're trying to do. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
fantasma62 Posted November 25, 2002 Author Posted November 25, 2002 Sorry, I have 4 different books and none talk about that.... Thanks for the information, you have provided... Again, I am sorry for my lack of information.... Quote
fantasma62 Posted November 25, 2002 Author Posted November 25, 2002 Success. I got it to work, I had simply forgotten to add the frmParent.show at the Tick event of the splash screen.... Thank you again for your help....I hope that when I have learned enough, I'll be able to help out another.... Thanks.. 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.