is anyone able to help me in anyway?
Printable View
is anyone able to help me in anyway?
Actually, going back to the original code might be most efficient:
VB Code:
Private Sub Form_Load() WebBrowser1.Navigate ("http://google.com") Timer1.Interval = 60000 '60 seconds; 1 minute Timer1.Enabled = True End Sub Private Sub Timer1_Timer() Static iCounter As Integer iCounter = iCounter + 1 If iCounter = 6 Then frmBrowser.Show WebBrowser1.Navigate ("http://yahoo.com") End If If iCounter = 12 Then frmBrowser.Show WebBrowser1.Navigate ("http://cnn.com") Timer1.Enabled = False End If End Sub
Every 1 minute, the Timer1 code will execute. That makes iCounter increase itself by one every minute. Therefore, after 6 minutes (6 intervals of 1 minute), iCounter will be 6 and the first If block will execute. With the second one, after 12 minutes (12 1-minute intervals), it will execute.
With what phreak was doing, using a string is kinda innefficient, not to mention it would have to execute 1000 times per second. Longs hold up to 232/2 which is 2,147,483,648, and will work well there, though simply setting the interval to 60,000 (1 minute; 60 seconds; 60,000 ms) with an increment counter is much for efficient.
Thank you for the codes and taking the time to explain how it works. I have much love and respect for you, Thanks Jemidiah, SLH, EJ12N and «°°phReAk°°»