0

我开始编码,我在创建的 VB.NET 应用程序中遇到了问题。

当加载一个新网页时,Webbrowser1我希望我的代码打开一个链接以在您自己的网络浏览器中执行,即 chrome、Firefox。

我该怎么做呢?

4

1 回答 1

0
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-10T04:11:21.263 回答