有没有办法检测一个人点击WebBrowser1里面的链接,然后我就可以了
Process.Start(TheURL)
然后将操作返回为false,这样它就不会单击webbrowser对象中的链接而只是单击该过程。
答案 0 :(得分:1)
这里你去:
private void WebBrowser_Navigating(object sender, WebBrowserNavigatingEventArgs e)
{
e.Cancel = true; // Cancel the event to avoid default behavior
System.Diagnostics.Process.Start(e.Url.ToString()); // Open the link in the default browser
}
编辑:嗯,我有几分钟。在这里,你再来一次:
Private Sub WebBrowser1_Navigating(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserNavigatingEventArgs) Handles WebBrowser1.Navigating
e.Cancel = True 'Cancel the event to avoid default behavior
System.Diagnostics.Process.Start(e.Url.ToString()) 'Open the link in the default browser
End Sub