webbrowser打开新窗口事件+=
测试可用:
private void SaveSnapshot_Click(object sender, EventArgs e) { this.webBrowser1.Navigate(txturl.Text); this.webBrowser1.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(webBrowser_DocumentCompleted); // 增加网页加载完成事件处理函数 this.webBrowser1.NewWindow += new CancelEventHandler(webBrowser_NewWindow); } void webBrowser_NewWindow(object sender,CancelEventArgs e) { string url=((WebBrowser)sender).StatusText; this.webBrowser1.Navigate(url); e.Cancel = true; }