PDA

View Full Version : سوال: توقف وب بروزر پس از مدتی



علیرضا.ا
جمعه 03 آبان 1392, 13:02 عصر
سلام
چجوری میتونم تنظیم کنم که اگه لود یه سایت مثلا بیشتر از 5 ثانیه طول کشید وب بروزر stop بشه؟:متفکر:

aliagamon
جمعه 03 آبان 1392, 13:35 عصر
Private Sub webBrowser1_Navigating(sender As Object, e As WebBrowserNavigatingEventArgs)
counter = 0
timer1.Interval = 1000
timer1.Enabled = True

End Sub
Private Sub webBrowser1_DocumentCompleted(sender As Object, e As WebBrowserDocumentCompletedEventArgs)
timer1.Enabled = False
End Sub
Private Sub timer1_Tick(sender As Object, e As EventArgs)
counter += 1
If counter >= 5 Then
timer1.Enabled = False
webBrowser1.[Stop]()
End If
End Sub