System.Windows.Forms
2.0.0.0
System.Object
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 . Rather, 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. 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 property of ; if the page uses frames, you can access their documents through the collection, which consists of one or more objects.
When your host the control in a Windows Forms application, you can choose to interact with the user using standard Windows Forms classes, such as or , or you can use methods on defined for this purpose. The method presents a simple dialog box with custom text and an OK button; presents a line of custom text and a text input field to the user; and presents a dialog box with a line of custom text and OK and Cancel buttons.
You can use to open new windows containing new documents. loads the specified URL into the named window, creating it if it does not already exist, while always opens its URL in a newly created window.
Represents the logical window that contains one or more instances of .
Method
2.0.0.0
System.Void
The class offers a more powerful version of the method.
Although accepts Unicode text as input, the Internet Explorer script prompt will not display non-Latin language text appropriately on Windows 95, Windows 98, Windows ME or Windows NT due to operating system limitations. For more information, see INFO: Internet Explorer Script Prompts and MBCS/Unicode.
Displays a message box.
The to display in the message box.
Method
2.0.0.0
System.Void
You should not attach an event to an HTML document or one of its objects until the document has completed loading. The earliest you should call this method is in the event of the control.
Adds an event handler for the named HTML DOM event.
The name of the event you want to handle.
A reference to the managed code that handles the event.
Method
2.0.0.0
System.Void
Use the property to determine if the window is already closed. If the window is already closed, this method will have no effect.
When you create new windows using or , causes the HTML Document Object Model to open a new instance of Internet Explorer. If you do not call on all of the windows you have created, this instance of Internet Explorer will remain running even after your application closes.
Closes the window.
Method
2.0.0.0
System.Boolean
displays a modal dialog box; the user will not be able to access the underlying HTML page without first closing this dialog box.
Although accepts Unicode text as input, the Internet Explorer script prompt will not display non-Latin language text appropriately on Windows 95, Windows 98, Windows ME or Windows NT due to operating system limitations. For more information, see INFO: Internet Explorer Script Prompts and MBCS/Unicode.
Displays a dialog box with a message and buttons to solicit a yes/no response.
true if the user clicked Yes; false if the user clicked No or closed the dialog box.
The text to display to the user.
Method
2.0.0.0
System.Void
To be added.
Removes the named event handler.
The name of the event you want to handle.
A reference to the managed code that handles the event.
Property
2.0.0.0
System.Windows.Forms.HtmlDocument
To be added.
Typically, you will access the through the property of the control. Use this property when you need to access a document within a FRAME using the collection.
Gets the HTML document contained within the window.
Property
2.0.0.0
System.Object
To be added.
Use the underlying unmanaged interface pointers to the Document Object Model (DOM) to execute methods not exposed by .
You must add a referenced to the unmanaged MSHTML.dll in order to use . For more information, see Importing a Type Library as an Assembly.
Gets the unmanaged interface wrapped by this class.
Method
2.0.0.0
System.Boolean
To be added.
Tests the object for equality against the current object.
true if the objects are equal; otherwise, false.
The object to test.
Event
2.0.0.0
System.Windows.Forms.HtmlElementErrorEventHandler
HTML pages can contain script code, usually written in JScript or VBScript, that executes when a page is loaded. occurs whenever a script encounters a run-time error. Because script code is late-bound, which means that calls against the object are not resolved until run-time, errors can include everything from referencing a null object to calling an undefined property or method.
You can set the property of to true in order to prevent the native error dialog box in Internet Explorer from displaying.
For more information about the difference between canceling event bubbling and canceling the default action on an event, see About the DHTML Object Model.
Occurs when script running inside of the window encounters a run-time error.
Method
2.0.0.0
System.Void
If another window held the focus before was called, that window will lose the focus.
Do not call focus on an element inside of a window until the window's event has been raised.
Puts the focus on the current window.
Property
2.0.0.0
System.Windows.Forms.HtmlWindowCollection
To be added.
A FRAME is a set of windows defined within a FRAMESET. FRAMEs enable hosting multiple documents within a single document. Each FRAME is defined as possessing a certain row and column width, and is position on the page in relation to the other FRAMEs defined within the FRAMESET; the position of a FRAME is fixed, although a user may sometimes use the mouse cursor to grow or shrink the FRAME. An IFRAME is similar to a frame, but it need not be anchored in a fixed position.
Frames will contain one instance of for each FRAME or IFRAME defined within a Web page.
Gets a reference to each of the FRAME elements defined within the Web page.
Method
2.0.0.0
System.Int32
To be added.
To be added.
System.Int32
Event
2.0.0.0
System.Windows.Forms.HtmlElementEventHandler
will occur for:
-
The first window in a FRAMESET when the FRAMESET first loads.
-
The FRAME that last had focus when the window containing the control is brought to the foreground.
-
A FRAME clicked by the user, but only if the user's click does not put focus on an element within the window.
You cannot cancel the default action for the event, or prevent it from bubbling. For more information about the difference between canceling event bubbling and canceling the default action on an event, see About the DHTML Object Model.
Occurs when the current window obtains user input focus.
Property
2.0.0.0
System.Windows.Forms.HtmlHistory
To be added.
contains all URLs navigated to within the current window, which is referred to as the navigation stack, and provides methods for navigating back to those documents.
Gets an object containing the user's most recently visited URLs.
Property
2.0.0.0
System.Boolean
To be added.
If the has been closed by the user or by way of a call to the method, attempting to navigate to a new URL or access the window's document will result in an error. Use this property to determine whether it is safe to call properties and methods on the current window object.
Gets a value indicating whether this window is open or closed.
Event
2.0.0.0
System.Windows.Forms.HtmlElementEventHandler
The event works similarly to the event on the control: it signals that it is safe to access HTML elements inside of the document.
You cannot cancel the default action for the event.
For more information about the difference between canceling event bubbling and canceling the default action on an event, see About the DHTML Object Model.
Occurs when the window's document and all of its elements have finished initializing.
Event
2.0.0.0
System.Windows.Forms.HtmlElementEventHandler
To be added.
Occurs when user input focus has left the window.
Method
2.0.0.0
System.Void
You cannot use to move a window off of the visible edge of the screen; this method is also available through script on a Web page, and allowing untrusted script to render windows invisible is not considered secure.
will raise an if the window you are trying to move and its parent window have different top-level domains. For example, if you are hosting the control pointing to a.adatum.com, create a new window using to display b.adatum.com. In this case, both windows are considered to be part of the same top-level domain, and the exception is not thrown. However, if you call to display www,microsoft.com, the two windows now have different top-level domains, and the operation will cause the exception to throw.
Moves the window to the specified coordinates on the screen.
The x- and y-coordinates of the window's upper-left corner.
Method
2.0.0.0
System.Void
You cannot use to move a window off of the visible edge of the screen; this method is also available through script on a Web page, and allowing untrusted script to render windows invisible is not considered secure.
will raise an if the window you are trying to move and its parent window have different top-level domains. For example, if you are hosting the control and it is pointing to a.adatum.com, you create a new window using to display b.adatum.com. In this case, both windows are considered to be part of the same top-level domain, and the exception is not thrown. However, if you call to display www,microsoft.com, the two windows now have different top-level domains, and the operation will cause the exception to throw.
Moves the window to the specified coordinates on the screen.
The x-coordinate of the window's upper-left corner.
The y-coordinate of the window's upper-left corner.
Property
2.0.0.0
System.String
To be added.
To be added.
Gets or sets the name of the window.
Method
2.0.0.0
System.Void
If the parameter points to an HTML page, the page currently displayed in the window will be destroyed and replaced with the new page; any references your application holds to managed DOM objects in the old page will not be valid. If points to a resource that cannot be displayed by Internet Explorer, the user will be presented with a dialog box asking whether to open the resource outside of the application, save it to disk, or cancel the download operation.
Displays or downloads the new content located at the specified URL.
The resource to display, described by a Uniform Resource Locator.
Method
2.0.0.0
System.Void
To be added.
Displays a new document in the current window.
The location, specified as a , of the document or object to display in the current window.
Method
2.0.0.0
System.Boolean
The equality operator tests the IUnknown pointers of the underlying COM objects wrapped by the supplied classes.
Tests the two objects for equality.
true if both parameters are null, or if both elements have the same underlying COM interface; otherwise, false.
The first object.
The second object.
Method
2.0.0.0
System.Boolean
To be added.
Tests two HtmlWindow objects for inequality.
true if one but not both of the objects is null, or the underlying COM pointers do not match; otherwise, false.
The first object.
The second object.
Method
2.0.0.0
System.Windows.Forms.HtmlWindow
The parameter can name a window that was created as the result of a previous call to . 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 parameter, any option not included is automatically disabled. In other words, if you only specify by way of 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 .
If the file referenced by 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 or , it causes the HTML Document Object Model to open a new instance of Internet Explorer. If you do not call 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 to load a URL in an existing window, will be ignored; the window will retain the dimensions, appearance, and screen location first given it by the initial call to .
Displays a file in the named window.
An representing the new window, or the previously created window named by the parameter.
The Uniform Resource Locator that describes the location of the file to load.
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:
A comma-delimited string consisting of zero or more of the following options in the form . 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.
Whether replaces the current window's URL in the navigation history. This will effect the operation of methods on the class.
Method
2.0.0.0
System.Windows.Forms.HtmlWindow
The parameter can name a window that was created as the result of a previous call to . 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 parameter, any option not included is automatically disabled. In other words, if you only specify by way of 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 .
If the file referenced by 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 or , it causes the HTML Document Object Model to open a new instance of Internet Explorer. If you do not call 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 to load a URL in an existing window, will be ignored; the window will retain the dimensions, appearance, and screen location first given it by the initial call to .
Displays a file in the named window.
An representing the new window, or the previously created window named by the parameter.
The Uniform Resource Locator that describes the location of the file to load.
The name of the window in which to open the resource. This can be a developer-supplied name, or one of the following special values:
A comma-delimited string consisting of zero or more of the following options in the form . 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.
Whether replaces the current window's URL in the navigation history. This will effect the operation of methods on the class.
Property
2.0.0.0
System.Windows.Forms.HtmlWindow
To be added.
To be added.
Gets a reference to the window that opened the current window.
Method
2.0.0.0
System.Windows.Forms.HtmlWindow
If the file referenced by is an HTML file, text file, or other file type that can be hosted inside of Internet Explorer, it will be displayed in a new window. If the file cannot be displayed inside of Internet Explorer, 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 or , it causes the HTML Document Object Model to open a new instance of Internet Explorer. If you do not call on all of the windows you have created, this instance of Internet Explorer will remain running even after your application has quit.
If you want to load a document into a previously opened window, see the method.
Displays a file in a new window.
An representing the new window.
The Uniform Resource Locator that describes the location of the file to load.
A comma-delimited string consisting of zero or more of the following options in the form . See for a full description of the valid options.
Method
2.0.0.0
System.Windows.Forms.HtmlWindow
If the file referenced by is an HTML file, text file, or other file type that can be hosted inside of Internet Explorer, it will be displayed in a new window. If the file cannot be displayed inside of Internet Explorer, 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 or , it causes the HTML Document Object Model to open a new instance of Internet Explorer. If you do not call on all of the windows you have created, this instance of Internet Explorer will remain running even after your application has quit.
If you want to load a document into a previously opened window, see the method.
Displays a file in a new window.
An representing the new window.
The Uniform Resource Locator that describes the location of the file to load.
A comma-delimited string consisting of zero or more of the following options in the form . See for a full description of the valid options.
Property
2.0.0.0
System.Windows.Forms.HtmlWindow
To be added.
In a document containing frames, each FRAME within a FRAMESET acts as a separate child window on the page. The parent of each FRAME is the FRAMESET which contains the FRAME.
Gets the window which resides above the current one in a page containing frames.
Property
2.0.0.0
System.Drawing.Point
To be added.
The property of the control will return the position of the control relative to the upper-left corner of the form. By contrast, will return the location of the document's display area relative to the top-left corner of the user's monitor.
Gets the position of the window's client area on the screen.
Method
2.0.0.0
System.String
provides a quick, easy way to obtain simple text input from the user.
Although accepts Unicode text as input, the Internet Explorer script prompt will not display non-Latin language text appropriately on Windows 95, Windows 98, Windows ME or Windows NT due to operating system limitations. For more information, see INFO: Internet Explorer Script Prompts and MBCS/Unicode.
Shows a dialog box that displays a message and a text box to the user.
A representing the text entered by the user.
The message to display to the user.
The default value displayed in the text box.
Method
2.0.0.0
System.Void
When called on a FRAME window in a FRAMESET, will cause that window to lose focus, but it will not automatically set focus on another window.
Takes focus off of the current window.
Event
2.0.0.0
System.Windows.Forms.HtmlElementEventHandler
To be added.
Occurs when the user uses the mouse to change the dimensions of the window.
Method
2.0.0.0
System.Void
To be added.
Changes the size of the window to the specified dimensions.
A describing the desired width and height of the window, in pixels. Must be 100 pixels or more in both dimensions.
Method
2.0.0.0
System.Void
To be added.
Changes the size of the window to the specified dimensions.
Describes the desired width of the window, in pixels. Must be 100 pixels or more.
Describes the desired height of the window, in pixels. Must be 100 pixels or more.
Event
2.0.0.0
System.Windows.Forms.HtmlElementEventHandler
To be added.
Occurs when the user scrolls through the window to view off-screen text.
Method
2.0.0.0
System.Void
will cause the document to scroll so that the specified coordinate on the document is located in the upper-left corner of the document's window. If the document is not long or wide enough for this to happen, will scroll through the document as far as possible in the specified direction.
Moves the window to the specified coordinates.
The x- and y-coordinates, relative to the top-left corner of the current window, toward which the page should scroll.
Method
2.0.0.0
System.Void
will cause the document to scroll so that the specified coordinate on the document is located in the upper-left corner of the document's window. If the document is not long or wide enough for this to happen, will scroll through the document as far as possible in the specified direction.
Scrolls the window to the designated position.
The x-coordinate, relative to the top-left corner of the current window, toward which the page should scroll.
The y-coordinate, relative to the top-left corner of the current window, toward which the page should scroll.
Property
2.0.0.0
System.Drawing.Size
To be added.
To be added.
Gets or sets the size of the current window.
Property
2.0.0.0
System.String
To be added.
The control does not display a status bar. Any new window that you open with the or methods, however, will display a status bar by default.
Gets or sets the text displayed in the status bar of a window.
Event
2.0.0.0
System.Windows.Forms.HtmlElementEventHandler
To be added.
Occurs when the current page is unloading, and a new page is about to be displayed.
Property
2.0.0.0
System.Uri
To be added.
This property is read-only. To navigate the window to a new document, use the method.
Gets the URL corresponding to the current item displayed in the window.
Property
2.0.0.0
System.Windows.Forms.HtmlElement
To be added.
When you retrieve a FRAME element from the collection, it returns an . Call on this object if you need to access attributes of the underlying FRAME element, such as the SRC attribute.
Gets the frame element corresponding to this window.