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
Process.Start
will open the URL in the default browser, and then you just tell the WebBrowser
control to cancel navigation.
private void webBrowser1_Navigating(object sender, WebBrowserNavigatingEventArgs e)
{
Process.Start(e.Url.ToString());
e.Cancel = true;
}
I just created a sample app to test it - it worked.