Solve the Problem of opening the link to call the IE window in WebBrowser

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.