我认为标题已经概括了一切。我使用控件显示一些基本的HTML和一些标记,其中可能还有链接。我想要做的是,强制点击任何链接都会在新的IE窗口中打开此链接,而不是在控件本身导航到该页面。
有什么想法吗?
我认为标题已经概括了一切。我使用控件显示一些基本的HTML和一些标记,其中可能还有链接。我想要做的是,强制点击任何链接都会在新的IE窗口中打开此链接,而不是在控件本身导航到该页面。
有什么想法吗?
private void webBrowser1_Navigating(object sender, WebBrowserNavigatingEventArgs e)
{
// prevents WebBrowser to navigate
if (e.Url.Host.Length > 0) // Otherwise the default about:blank when you init the control doesn't work
{
e.Cancel = true;
// Open the URL in an IE window
System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo.FileName = e.Url.ToString();
process.Start();
}
}