When the web browser is used to display a webpage, you can click the link in it to open IE instead of Webbrowser. To solve this problem. After a large number of Google and baidu, I found the following solutions. I used the first one, and the rest were not practiced for reference:
1. Use the NewWindow3 event.
Introduce SHDocVw. dll // You Want to package the dll file together for download, but you cannot find the place to paste the attachment. A friend needs to find it by himself.
Using SHDocVw;
Using System;
Using System. Collections. Generic;
Using System. ComponentModel;
Using System. Data;
Using System. Drawing;
Using System. Text;
Using System. Windows. Forms;
Using System. Reflection;
Namespace WindowsApplication24
...{
Public partial class Form1: Form
...{
Public Form1 ()
...{
InitializeComponent ();
This. webBrowser1.Navigate ("about: blank ");
(This. webBrowser1.ActiveXInstance as SHDocVw. WebBrowser). NewWindow3 + = new SHDocVw. DWebBrowserEvents2_NewWindow3EventHandler (Form1_NewWindow3 );
}
Void Form1_NewWindow3 (ref object ppDisp, ref bool Cancel, uint dwFlags, string bstrUrlContext, string bstrUrl)
...{
Cancel = true;
This. webBrowser1.Navigate (bstrUrl );
}
Private void button#click (object sender, EventArgs e)
...{
This. webBrowser1.Navigate ("http://www.google.cn /");
}
}
}
II. Give a link: http://hi.baidu.com/zhitenglin/blog/item/5d1614f3b09fe6cc0a46e011.html