Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Activating a splash screen form

Activating a splash screen form

Activating a splash screen form

Thanks to everyone for responding to my previous question, I think this forum is great and of a lot of value. I am a novice, and there are just some things I can't find I my VB books or in Help files.

In any case my question is how do I go about activating a splash screen. I have the form built, but when I run it it does not show up. When I do get it to show by typing Form1.Show - it shows up then stays up there, not appearing then disappearing at the start of a run like it should. So that is obviously not the solution. Can anyone help me with this, I have been trying to get it to work with a timer, but can't!

RE: Activating a splash screen form

You can choose the form with which the application starts by choosing its name under project.. properties.. general... startup object. Choose the name of the splash screen form here. In the form load event of this form you can load your main form

RE: Activating a splash screen form


Another way of doing this is to create a Sub Main procedure in a general module attached to your project. In it you may show the splash screen (FromName.Show) and while it is being displayed you can do other operations like opening a database or something you would like to do before showing the main form of your project. After your background processing you may hide or unload the splash screen (either FormName.Hide or UnLoad FormName) and then show the main form - MDIForm.Show or WhatEverFormName.Show.

To activate the Sub Main procedure at startup you change the startup Object in the Project, ProjectName Properties SubMenu and for startup Object, replace the FormName with Sub Main.

I hope this idea is useful.

RE: Activating a splash screen form

Thanks for the response guys. Peekay, I tried your solution. The splash form only goes away if the user clicks it or presses a key, which is great. Hope I'm not being too picky but I've seen others where they go away after a certain amount of time. Are the programs doing things before hiding the splash forms like Liberty wrote? I don't really have any background processing to enable that, so I was wondering if it is worth it to program a "timed" splash screen or if it is acceptable programming practice to have a splash screen that goes away when the user clicks it.



RE: Activating a splash screen form

It has been a while, so you may already be on to bigger and better things. If not, I think this might do what you want.
I don't know if the timer control is available on all versions.

Assumes 2 forms, form1 and form2.
Form1 is the “splash” form. Place a timer on it with the code shown below. (timer is invisible at run time)

Form2 would be the main processing form.
Be sure to adjust the project properties so that "sub main" is the startup object.

‘module module1--------------------------------------------
Option Explicit

Private Sub main()
Form1.Timer1.Interval = 2000 'in milliseconds
Form1.Timer1.Enabled = True
End Sub

‘ form1---------------------------------------------------
Option Explicit

Private Sub Timer1_Timer()
Timer1.Enabled = False
Unload Form1
Form2.Show ‘form2 holds your main processing.
End Sub

RE: Activating a splash screen form

Use Refresh method after Show:

Load frmMain
Unload frmSplash

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close