HtmlDocument.OpenNew Method (Boolean)
.NET Framework (current version)
System.Windows.Forms (in System.Windows.Forms.dll)
public HtmlDocument OpenNew(
Whether the new window's navigation should replace the previous element in the navigation history of the DOM.
OpenNew will clear the previous loaded document, including any associated state, such as variables. It will not cause navigation events in WebBrowser to be raised.
OpenNew always creates a new document in the current window. To open a document in a new window, use the Open method on the HtmlWindow class.
The following code example prepares the DOM for writing and writes a new document using the Write method.
private void WriteNewDocument()
if (webBrowser1.Document != null)
HtmlDocument doc = webBrowser1.Document.OpenNew(true);
doc.Write("<HTML><BODY>This is a new HTML document.</BODY></HTML>");
Return to top
Available since 2.0