is there a way to make the splash screen show for just a few seconds then have it automatically dissappear instead of waiting for a keypress or click......
Printable View
is there a way to make the splash screen show for just a few seconds then have it automatically dissappear instead of waiting for a keypress or click......
Something like:
VB Code:
Option Explicit Private Sub Form_Load() 'Start timer Timer1.Interval = 2000 '2 Seconds Timer1.Enabled = True End Sub Private Sub Timer1_Timer() 'Disable the timer and show Form2 Timer1.Enabled = False Unload Form1 Form2.Show End Sub Private Sub Form_dblClick() 'Gives the user a method to close off the Form1 (SplashScreen) Unload Form1 Form2.Show End Sub
Edited.......
Or something likeVB Code:
' In a module... Option Explicit Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) Sub Main() frmSplash.Show frmSplash.Refresh Sleep (1000) ' Sleep for 1 second. Load frmMain Unload frmSplash frmMain.Show End Sub
This will work place a timer on your form
VB Code:
Private Sub Form_Load() 'Start timer and give it interval which is five seconds Timer1.Interval = 5000 Timer1.Enabled = True End Sub Private Sub Timer1_Timer() Form2.Show Unload Form1 'Disable the timer and show Form2 Timer1.Enabled = False End Sub
Bruce Fox the code is good except you should always placeafter you place the statements you want it to execute so that code for the timer should be on the last line of timer1 declarationVB Code:
Tmer1.Enabled= False