Vb: how to pause a loop for a certain amount of time and then continue?

前端 未结 1 347
长发绾君心
长发绾君心 2021-01-24 07:20
    Dim d As Integer
    For d = 0 To TextBox2.Text

        WebBrowser1.Navigate(TextBox1.Text)

       //a code that pauses the loop but does not stop the browser thre         


        
1条回答
  •  情话喂你
    2021-01-24 07:36

    I'm not sure if the browser is rendering on a separate thread. If it is then the following should work:

    System.Threading.Thread.Sleep(3000) ' Sleep for 3 seconds
    

    If the browser control is rendering on the same thread as your application then you will have to refactor the code to utilize a timer as Thomas L suggested.

    0 讨论(0)
提交回复
热议问题