System.Windows.Forms.HtmlWindow Class

Represents the logical window that contains one or more instances of System.Windows.Forms.HtmlDocument.

See Also: HtmlWindow Members

Syntax

public sealed class HtmlWindow

Remarks

System.Windows.Forms.HtmlWindow should not be confused with the concept of a window in Windows Forms or the Win32 API; there is no HWND or similar Windows resource that corresponds directly to an instance of System.Windows.Forms.HtmlWindow. Rather, System.Windows.Forms.HtmlWindow provides high-level descriptions of a document's location on a user's screen, as well as methods for interacting with users by way of prompts and dialog boxes. System.Windows.Forms.HtmlWindow acts as a logical container for a Web page's documents and its metadata, such as the document's location and the capabilities of the Web browser.

A Web page consists of a single document, or a FRAMESET containing one or more FRAME elements, each of which hosts its own document. Web developers use framesets to show logically related pages side by side (for example, a content page next to a navigation page). When a page consists of a single document, you can access it through the HtmlWindow.Document property of System.Windows.Forms.HtmlWindow; if the page uses frames, you can access their documents through the HtmlWindow.Frames collection, which consists of one or more System.Windows.Forms.HtmlWindow objects.

When your host the System.Windows.Forms.WebBrowser control in a Windows Forms application, you can choose to interact with the user using standard Windows Forms classes, such as System.Windows.Forms.Form or System.Windows.Forms.MessageBox, or you can use methods on System.Windows.Forms.HtmlWindow defined for this purpose. The HtmlWindow.Alert(string) method presents a simple dialog box with custom text and an OK button; HtmlWindow.Prompt(string, string) presents a line of custom text and a text input field to the user; and HtmlWindow.Confirm(string) presents a dialog box with a line of custom text and OK and Cancel buttons.

You can use System.Windows.Forms.HtmlWindow to open new windows containing new documents. HtmlWindow.Open(string, string, string, bool) loads the specified URL into the named window, creating it if it does not already exist, while HtmlWindow.OpenNew(string, string) always opens its URL in a newly created window.

Requirements

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