• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 267
  • Last Modified:

USING TIMER WITHIN A VB APPLICATION.....

I am fairly new to VB,  and am trying to create a new application that briefly displays a splash form when executing the application.  I would like the splash form to display for 5 seconds and then to open another form.  I have tried adding a timer onto my startup splash form,  and setting the parameters but doesn't seem to work.  Could anybody let me know how to use the Timer to close down a form after the specified interval setting.  

Thanks.
Steveeb.
0
SBrighty
Asked:
SBrighty
1 Solution
 
SBrightyAuthor Commented:
ANY Ideas....
0
 
ClivenCommented:
paste this code in splash form. Remember to add the timer controler active x into splash.

Private Sub Form_Load()
Timer1.Interval = 5000
End Sub

Private Sub Timer1_Timer()
Form1.Show 'Next form to be show
Unload Me
End Sub
0
 
yronnenCommented:
Cliven's answer has one problem. If your main form of the application is the splash form, and yuo will unload it after loading the Form1, the application will shut down...

The solution is to add a simple vb motule with a procedure called main, and set the module and procedure as startup object in the project properties. In this procedure you should load the splash form and the main form.

You can ask VB to do all the above automatically by selecting the VB application wizard and choosing a splash screen. This will do the dirty work for you. You can then implement Cliven's code and just remove the "Form1.Show" line.
0

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now