我開始編碼,並且在創建的VB.NET應用程序中遇到問題。一旦Webbrowser1更改頁面,立即打開一個網頁?
在Webbrowser1
中加載新網頁時,我希望我的代碼打開一個鏈接,以在您自己的瀏覽器中執行,即Chrome,Firefox。
我該如何去做這件事?
我開始編碼,並且在創建的VB.NET應用程序中遇到問題。一旦Webbrowser1更改頁面,立即打開一個網頁?
在Webbrowser1
中加載新網頁時,我希望我的代碼打開一個鏈接,以在您自己的瀏覽器中執行,即Chrome,Firefox。
我該如何去做這件事?
Public Class Form1
Dim FirstRun As Boolean = True
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
WebBrowser1.Navigate("http://stackoverflow.com")
End Sub
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
If Not FirstRun Then Process.Start("http://stackoverflow.com")
FirstRun = False
End Sub
End Class
這不是初學者的任務。 – 2013-02-12 02:35:35