How do I prevent a new page from being opened outside the WebBrowser?
In the WebBrowser control, we can handle the NewWindow event so that new popup windows will be opened in the WebBrowser.
Here is the code sample:
private void webBrowser1_NewWindow(object sender, CancelEventArgs e)
e.Cancel = true;
For more FAQ about Visual C# General, please see Visual C# General FAQ
Please remember to mark the replies as answers if they help and unmark them if they provide no help. Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
Microsoft is conducting an online survey to understand your opinion of the Msdn Web site. If you choose to participate, the online survey will be presented to you when you leave the Msdn Web site.
Would you like to participate?