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 dont 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
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 dont 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