0

Hello ,I have one problem making one simple program(actually I am new in this language).
So I have two webbrowsers.How I can every New Window that is opened in webbrowser1 to be opened in webbrowser2 instead?

Thanks in advance

2
Contributors
5
Replies
6
Views
6 Years
Discussion Span
Last Post by Momerath
1

Attach an event to the WebBrowser.Navigating event:

private void webBrowser1_Navigating(object sender, WebBrowserNavigatingEventArgs e) {
    e.Cancel = true;  // prevents this webbrowser from changing page
    webBrowser2.Navigate(e.Url); // makes the 2nd webbrowser navigate to the link
}
0

Yes it works for pop-ups.the main problems is that ,if i click in webbrowser1 in some link(which is opened in new window) ,automaticaly starts IE.I want to be loaded in Webbrowser2 instead.

0
private void webBrowser1_NewWindow(object sender, System.ComponentModel.CancelEventArgs e) {
    e.Cancel = true;
}
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.