Oky i have a big problem that needs help fixing
Here's my code :

 Private Sub FullLoginTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FullLoginTimer.Tick
            Try
                If MbFacebookBrowser.Document.Url.AbsoluteUri = "http://www.facebook.com/login.php" Then
                    MbFacebookBrowser.Document.GetElementById("email").SetAttribute("value", Emailtxt.Text)
                    MbFacebookBrowser.Document.GetElementById("pass").SetAttribute("value", Passwordtxt.Text)
                    MbFacebookBrowser.Document.GetElementById("Login").InvokeMember("click")
                End If
            Catch skipErrors As Exception
                Try
                    If MbFacebookBrowser.Document.Url.AbsoluteUri = "http://www.facebook.com/login.php" Then
                        MbFacebookBrowser.Document.GetElementById("pass").SetAttribute("value", Passwordtxt.Text)
                        MbFacebookBrowser.Document.GetElementById("Login").InvokeMember("click")
                        FullLoginTimer.Stop()
                     **   '(Rem)MbFacebookBrowser.Navigate("s7.moonbase.mobi/Home/Landing")**
                    Else
                    End If
                Catch dd As Exception
                End Try
            End Try
End Sub

How can let the this timer wait for webpage to complete so that i can navigate to the webpage
In the (Rem) is the navigate part but password has to be submitted first
so anybody please if you maybe have an idea please post it

Sorry for Posting the code like this but there's no other Way -_-

Member Avatar for SeniorAlexandro

Make a Module and write this:

    Private Property pageready As Boolean = False

#Region "Page Loading Functions"
    Public Sub WaitForPageLoad()
        AddHandler Form1.MbFacebookBrowser.DocumentCompleted, New WebBrowserDocumentCompletedEventHandler(AddressOf PageWaiter)
        While Not pageready
            Application.DoEvents()
        End While
        pageready = False
    End Sub

    Private Sub PageWaiter(ByVal sender As Object, ByVal e As WebBrowserDocumentCompletedEventArgs)
        If Form1.MbFacebookBrowser.ReadyState = WebBrowserReadyState.Complete Then
            pageready = True
            RemoveHandler Form1.MbFacebookBrowser.DocumentCompleted, New WebBrowserDocumentCompletedEventHandler(AddressOf PageWaiter)
        End If
    End Sub

#End Region

Now just assign waitforpageload() after every loading of a URL.
Hope I helped you out.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.