Imports System.Windows.Forms Imports System.Threading Public Class GoogleSearch Dim WithEvents WBBrowser As New Windows.Forms.WebBrowser Dim TimCount As New System.Timers.Timer() Sub New(ByVal SearchParameter As String, ByVal ResultPage As Integer) TimCount.Interval = 2000 TimCount.Enabled = False AddHandler TimCount.Elapsed, AddressOf TimCount_Tick WBBrowser.Visible = True WBBrowser.ScriptErrorsSuppressed = True AddHandler WBBrowser.DocumentCompleted, AddressOf WBBrowser_DocumentCompleted WBBrowser.Navigate("http://www.google.com", False) End Sub Private Sub TimCount_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Try TimCount.Enabled = False // Some Code Goes Here Catch ex As Exception MsgBox(ex.Message) End Try End Sub Private Sub WBBrowser_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.EventArgs) Try If WBBrowser.ReadyState <> Windows.Forms.WebBrowserReadyState.Complete Then Return Else TimCount.Start() End If Catch ex As Exception MsgBox(ex.Message) End Try End Sub End Class
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)