System.Windows.Forms.WebBrowser.NewWindow Event

Occurs before a new browser window is opened.

Syntax

public event System.ComponentModel.CancelEventHandler NewWindow

Remarks

The System.Windows.Forms.WebBrowser control opens a separate browser window when the appropriate overload of the erload:System.Windows.Forms.WebBrowser.Navigate method is called or when the user clicks the Open in New Window option of the browser shortcut menu when the mouse pointer hovers over a hyperlink. You can disable the shortcut menu by setting the WebBrowser.IsWebBrowserContextMenuEnabled property to false.

The WebBrowser.NewWindow event occurs before the new browser window is opened. You can handle this event, for example, to prevent the window from opening when certain conditions have not been met.

For more information about handling events, see Consuming Events.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 2.0.0.0