我需要關於VB等待網頁加載的幫助。 單擊一個按鈕=>導航一頁並等待加載,然後更改一個標籤文本,然後導航另一個頁面並等待加載,然後更改另一個標籤文本,然後導航並等待加載另一個頁面,然後更改標籤文本。請幫助我,我試着用這個代碼,但是失敗...VB等網頁加載
Private Sub Button1_Click ...
WebBrowser1.Navigate("page1")
Label1.Text = "Loaded" 'but this show before the page loaded
WebBrowser1.Navigate("page2") 'this start loading before the page1 loaded
Label2.Text = "Loaded" 'but this show before the page loaded
WebBrowser1.Navigate("page3") 'this start loading before the page1 loaded
Label3.Text = "Loaded"
...
End Sub
沒有爲web瀏覽器,你可以使用'DocumentCompleted'事件。 – ajakblackgoat
是的,但如何使用它3-4-5頁。你能給我一個代碼嗎? :)) –
在活動內部,檢查網頁瀏覽器的網址,並在此基礎上,將相應的標籤設置爲「已加載」。 – ajakblackgoat