Syzis
Member
- Joined
- Apr 23, 2011
- Messages
- 10
- Programming Experience
- 3-5
Hello,
I have a basic question about timers, that I can't answer myself. It's annoying me.
My code is made to visit a website every X seconds.
There are two problems.
I Set the interval for 30 sec and the first visit should be right now, not after 30 seconds.
After that, wait 30 sec and navigate to another one (in a listbox). The problem is that the Timer is not waiting that time after the first visit.
My code:
Could you please help me?
I have a basic question about timers, that I can't answer myself. It's annoying me.
My code is made to visit a website every X seconds.
There are two problems.
I Set the interval for 30 sec and the first visit should be right now, not after 30 seconds.
After that, wait 30 sec and navigate to another one (in a listbox). The problem is that the Timer is not waiting that time after the first visit.
My code:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Timer1.Start() End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick Dim a As Integer Timer1.Interval = 30000 For a = 0 To ListBox1.Items.Count - 1 WebBrowser1.Navigate(ListBox1.Items(a)) Next a End Sub
Could you please help me?