How to open a link in webBrowser control in external browser?

前端 未结 6 1500
轮回少年
轮回少年 2020-12-15 19:39

I have a textBox and a webBrowser control in my Windows Forms application. Whenever a user enters a HTML code in textBox, the webBrowser control shows its compiled form. The

6条回答
  •  再見小時候
    2020-12-15 19:54

    This code here should work:

    private void webBrowser1_Navigating(object sender, WebBrowserNavigatingEventArgs e)
    {
        System.Diagnostics.Process.Start(e.Url.ToString());
    
        e.Cancel = true;
    }
    

    I tried this to be sure it worked and it does!

    Hope this helps!!

提交回复
热议问题