Click here to Skip to main content
15,843,145 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to extend time of splash screen in vb.net 2008?

I have 2 forms one is my main form(frmMain) and the other is my splash screen(frmSplash). In project properties I set the start form to frmMain and in splash screen frmSplash. When I run my project the splash screen display only 2 seconds. How can I extend the time?


thanks in advance.
Posted

add timer control on splash form
and on tick event put if condition when timer's time goes greater than desire time then close form and enable your MDI form

Happy coding!
:)
 
Share this answer
 
Comments
Johnny J. 17-Apr-13 9:21am    
The OP wants to use the built in splash screen functionality instead of coding his own, so this is not a solution to the OP's question...
You can code this:

Private Sub SplashScreenForm_Shown(sender As Object, e As EventArgs) Handles Me.Shown
   Application.DoEvents()
   Dim sw As New Stopwatch
   sw.Start()
   Do : Loop While sw.ElapsedMilliseconds < 3000
 End Sub
 
Share this answer
 
Comments
Thregarth 17-Apr-13 10:10am    
I think about writting this code in the Shown event, yout can ensure that the form with what you want to show, is being shown, after all controls are painted
Try this in your main form:

VB
Public Class MainForm

    Private WithEvents tmr As New Timer

    Private Sub MainForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        tmr.Interval = 5000
        tmr.Enabled = True

        Do While tmr.Enabled
            Application.DoEvents()
        Loop
    End Sub

    Private Sub tmr_Tick() Handles tmr.Tick
        tmr.Enabled = False
    End Sub

End Class
 
Share this answer
 
v2
Comments
Johnny J. 17-Apr-13 9:42am    
Thanks phantom. Missed the code tags

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900