Hi, I'm making a program that continueally refreshes the current website when you click a button. Here is the code:
What's wrong with it? It only refreshes once, and then it doesn't do anything.
Code:
[COLOR=blue]Private Sub[/COLOR] Button2_Click([COLOR=blue]ByVal[/COLOR] sender [COLOR=blue]As[/COLOR] System.Object, [COLOR=blue]ByVal[/COLOR] e [COLOR=blue]As[/COLOR] System.EventArgs) [COLOR=blue]Handles[/COLOR] Button2.Click
[COLOR=blue]Dim[/COLOR] i [COLOR=blue]As Integer[/COLOR]
[COLOR=blue]For[/COLOR] i = 1 [COLOR=blue]To[/COLOR] TextBox2.Text [COLOR=green]'Loop[/COLOR]
AxWebBrowser1.Refresh() [COLOR=green]'Refresh the page[/COLOR]
Timer1.Interval = TextBox3.Text [COLOR=green]'Time inbetween refreshing (time for page to load)[/COLOR]
Timer1.Enabled = [COLOR=blue]True[/COLOR] [COLOR=green]'Start the timer[/COLOR]
[COLOR=blue]Next[/COLOR]
[COLOR=blue]End Sub[/COLOR]
What's wrong with it? It only refreshes once, and then it doesn't do anything.
Last edited: