CodeItBetter Programming Another VB Programming Blog

How to use timer control for more than 65,535 milliseconds

Posted on January 8, 2012
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
'Controls - How to use timer control for more than 65,535 milliseconds
Dim Counter As Integer
Dim sec As Integer
 
Private Sub Form_Load()
    Timer1.Interval = 1000 '1 second
    Timer1.Enabled = True
End Sub
 
Private Sub Timer1_Timer()
    secs = secs + 1
 
    If secs = 30 Then
    Counter = Counter + 1 'counter for each 30 seconds that pass
    secs = 0 'rest for next 3
    End If
 
    If Counter = 4 Then '2 mins are up
    WebBrowser1.Navigate2 "www.google.com"
    Counter = 0 'reset
    End If
End Sub
Filed under: Controls Leave a comment
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


 

No trackbacks yet.