110,025
社区成员




private void webBrowser1_NewWindow(object sender, CancelEventArgs e)
{
this.webBrowser1.Navigate(webBrowser1.Url.ToString());
e.Cancel = true;
}
public Form4()
{
InitializeComponent();
(this.webBrowser1.ActiveXInstance as SHDocVw.WebBrowser).NewWindow3 += new SHDocVw.DWebBrowserEvents2_NewWindow3EventHandler(Form1_NewWindow3);//exception
}
void Form1_NewWindow3(ref object ppDisp, ref bool Cancel, uint dwFlags, string bstrUrlContext, string bstrUrl)
{
Cancel = true;
this.webBrowser1.Navigate(bstrUrl);
}