Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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........

???

  • *Gurus*
Posted

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()

MVP, Visual Developer - .NET

 

Now you see why evil will always triumph - because good is dumb.

 

My free .NET Windows Forms Controls and Articles

Posted
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....
Posted

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....

Posted

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..

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...