Click to See Complete Forum and Search --> : Timer?


rockinron
October 18th, 2001, 06:54 PM
is there anyway to make a screen appear for a length of time then disappear without input from the user?

ilynx
October 18th, 2001, 08:04 PM
place a timer in the form and set the time length then unload the form (or hide it)

rockinron
October 18th, 2001, 08:17 PM
can you give me a code example? i have not been able to get a timer to work

John G Duffy
October 18th, 2001, 08:25 PM
Very simple sample.
Start a new project. Add a timer (Timer1)
Paste this code into the general declarations section of the form
Run the project. The form will appear. In 5 seconds it will unload itself.

option Explicit

private Sub Form_Load()
Timer1.Interval = 5000 ' set interval for 5 seconds
Timer1.Enabled = true ' start the timer
End Sub

private Sub Timer1_Timer()
Unload me ' timer has expired. unload this form
End Sub




John G