is this correct
Private Sub Form_Load()
WebBrowser1.Navigate "http"
Timer1.Interval = 30000
End Sub
i want it to load a website then after 5 mins close this app
can anyone help
Printable View
is this correct
Private Sub Form_Load()
WebBrowser1.Navigate "http"
Timer1.Interval = 30000
End Sub
i want it to load a website then after 5 mins close this app
can anyone help
The Interval property is the number of milliseconds. 30000 is 30 seconds. The max of the Interval property is roughly a minute. In order to execute code at 5 minute intervals you need to keep a counter to track the number of minutes that have elapsed.
Code:Private Sub Form_Load()
WebBrowser1.Navigate "http"
Timer1.Interval = 60000 'fire the timer every minute
End Sub
Private Sub Timer1_Timer()
Static lngMinutes as Long
lngMinutes = lngMinutes + 1
If lngMinutes >=5 then
Timer1.Enabled = False
Unload Me
End if
End Sub