Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27356

VS 2010 WebBrowser1_DocumentCompleted event handleing

$
0
0
Ok i am struggling with this WebBrowser1_DocumentCompleted.

As i see it this code should

Set Flag to “1”
Navigate to google.com
Loop while Flag = “1”
When the web page has loaded the event should set flag to “0”
Loop should stop
And message box should show “0”

What don’t i understand here?


XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Public Class WebEventTest

Private Sub WebEventTest_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Flag = "1"
WebBrowser1.Navigate("https://www.google.com/")

Do While Flag = "1"

Loop
MessageBox.Show(Flag)
End Sub

Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
If Flag = "1" Then

Flag = "0"
End If
End Sub


End Class

Viewing all articles
Browse latest Browse all 27356

Trending Articles