System.Windows.Forms.HtmlWindow.Open Method

Displays a file in the named window.

Syntax

public HtmlWindow Open (string urlString, string target, string windowOptions, bool replaceEntry)

Parameters

urlString
The Uniform Resource Locator that describes the location of the file to load.
target
The name of the window in which to open the resource. This may be a developer-supplied name, or one of the following special values:
windowOptions
A comma-delimited string consisting of zero or more of the following options in the form name=value. Except for the left, top, height, and width options, which take arbitrary integers, each option accepts yes or 1, and no or 0, as valid values.
replaceEntry
Whether url replaces the current window's URL in the navigation history. This will effect the operation of methods on the System.Windows.Forms.HtmlHistory class.

Returns

An System.Windows.Forms.HtmlWindow representing the new window, or the previously created window named by the target parameter.

Remarks

The target parameter can name a window that was created as the result of a previous call to HtmlWindow.Open(string, string, string, bool). The parameter may also point to a window opened by clicking on a hyperlink (A element) or a FORM element that uses the TARGET attribute to open its URL in a new window. The following HTML code will open a new window named orderWindow when the user clicks it:

<A HREF="/startOrder.aspx" TARGET="orderWindow">Click to Start Order</a>

If you supply any options for the windowOptions parameter, any option not included is automatically disabled. In other words, if you only specify by way of windowOptions that you want a status bar, then the menu bar, toolbar, title, scroll bars, and so on will not be displayed unless you explicitly enable them by way of windowOptions.

If the file referenced by url is an HTML file, text file, or other file type that can be hosted inside of Internet Explorer, it will be displayed in the named window. If the file cannot be displayed inside of Internet Explorer, and the window named by target does not already exist, then the window will open only long enough for Internet Explorer to download the resource; it will close immediately afterwards.

When you create new windows using HtmlWindow.Open(string, string, string, bool) or HtmlWindow.OpenNew(string, string), it causes the HTML Document Object Model to open a new instance of Internet Explorer. If you do not call HtmlWindow.Close on all of the windows you have created, this instance of Internet Explorer will remain running even after your application has quit.

If you use HtmlWindow.Open(string, string, string, bool) to load a URL in an existing window, windowOptions will be ignored; the window will retain the dimensions, appearance, and screen location first given it by the initial call to HtmlWindow.Open(string, string, string, bool).

Requirements

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