System.Windows.Forms 2.0.0.0 System.Object provides a managed wrapper around Internet Explorer's document object, also known as the HTML Document Object Model (DOM). You obtain an instance of through the property of the control. HTML tags inside of an HTML document can be nested inside one another. thus represents a document tree, whose children are instances of the class. The following code example shows a simple HTML file. <HTML> <BODY> <DIV name="Span1">Simple HTML Form</DIV> <FORM> <SPAN name="TextLabel">Enter Your Name:</SPAN> <INPUT type="text" size="20" name="Text1"> </FORM> </BODY> </HTML> In this example, represents the entire document inside the HTML tags. The BODY, DIV, FORM and SPAN tags are represented by individual objects. There are several ways you can access the elements in this tree. Use the property to access the BODY tag and all of its children. The property gives you the for the element on an HTML page that has user input focus. All elements within an HTML page can have a name; the collection provides access to each using its name as an index. will return an of all objects with a given HTML tag name, such as DIV or TABLE. will return the single corresponding to the unique ID that you supply. will return the that can be found on the screen at the supplied mouse pointer coordinates. You can also use the and collection to iterate through elements that represent user input forms and graphics, respectively. is based on the unmanaged interfaces implemented by Internet Explorer's DHTML DOM: IHTMLDocument, IHTMLDocument2, IHTMLDocument3, and IHTMLDocument4. Only the most frequently used properties and methods on these unmanaged interfaces are exposed by . You can access all other properties and methods directly using the property, which you can cast to the desired unmanaged interface pointer. An HTML document may contain frames, which are different windows inside of the control. Each frame displays its own HTML page. The collection is available through the property. You may also use the property to resize the displayed page, scroll the document, or display alerts and prompts to the user. exposes the most common events you would expect to handle when hosting HTML pages. For events not exposed directly by the interface, you can add a handler for the event using . HTML files may contain SCRIPT tags that encapsulate code written in one of the Active Scripting languages, such as JScript or VBScript. The method provides for execution of properties and methods defined in a SCRIPT tag. While most of the properties, methods, and events on have kept the same names as they have on the unmanaged DOM, some have been changed for consistency with the dnprdnshort. Provides top-level programmatic access to an HTML document hosted by the control. Property 2.0.0.0 System.Windows.Forms.HtmlElement To be added. When the document has focus, but no element of the document has been given focus, returns the element corresponding to the <BODY> tag. If the document does not have focus, returns null. If the current element with input focus is a cell (TD) in an HTML TABLE tag, will return the element that contains the TABLE element. Provides the which currently has user input focus. Property 2.0.0.0 System.Drawing.Color To be added. A link is active when a user is clicking on it. Change this property to change the color of the link prior to navigation. The type in the dnprdnshort supports an Alpha value, but the HTML DOM does not. Therefore, Alpha will have no effect when assigned to this property. Gets or sets the of a hyperlink when clicked by a user. Property 2.0.0.0 System.Windows.Forms.HtmlElementCollection To be added. The collection provides random access to any element in the HTML document, regardless of its position in the document tree. Use it to access any element in an HTML document by name, ID, or index. You may also iterate over all of the elements within a document. Some elements, such as HEAD and TITLE, will never have names associated with them. All other elements will have names only if the author of the HTML file assigned them. You can access elements without names by ID or index. You cannot add elements directly to the collection, because all elements in an HTML file outside of the HTML tag must have a parent element. Use the method or the property on to add new elements to the tree. Gets an instance of , which stores all objects for the document. Method 2.0.0.0 System.Void You should not attach an event to the 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. This method allows you to attach handlers to unmanaged DOM events not exposed by . For more information about available unmanaged DOM events, see Accessing Unexposed Members on the Managed HTML Document Object Model and the IHTMLDocument interfaces: IHTMLDocument, IHTMLDocument2, IHTMLDocument3, IHTMLDocument4, IHTMLDocument5. Adds an event handler for the named HTML DOM event. The name of the event you want to handle. The managed code that handles the event. Property 2.0.0.0 System.Drawing.Color To be added. will display when no other element occupies that area of the screen. The type in the dnprdnshort supports an Alpha value, but the HTML DOM does not. Therefore, Alpha will have no effect when assigned to this property. Gets or sets the background color of the HTML document. Property 2.0.0.0 System.Windows.Forms.HtmlElement To be added. An HTML document is split into two major sections: HEAD, which contains the document's title, any document meta-data, and SCRIPT elements. BODY, which contains all of the elements involved in the on-screen appearance of the document. There is no equivalent Head property on . To obtain the HEAD element, use . Gets the for the BODY tag. Event 2.0.0.0 System.Windows.Forms.HtmlElementEventHandler For more information about handling events, see Consuming Events. Occurs when the user clicks anywhere on the document. Event 2.0.0.0 System.Windows.Forms.HtmlElementEventHandler By default, if you right-click your mouse on a document or an element in a document, it will display a default context menu particular to the element. Use this event to cancel the display of the context menu and display one of your own. Occurs when the user requests to display the document's context menu. Property 2.0.0.0 System.String To be added. The property of exposes all cookies set for a Web page. A cookie is an arbitrary name/value pair associated with a given Web page. Web developers use cookies to track when users visit or return to a Web site. A cookie is composed of multiple parts, called cookie crumbs, that determine the following: The document set to which the cookie applies; its domain and path. The name and value of the cookie. The expiration date of the cookie. Whether the cookie can only be sent using a secure connection. The property may contain multiple cookies. You can only use the property to set one cookie at a time. Gets or sets the HTTP cookies associated with this document. Method 2.0.0.0 System.Windows.Forms.HtmlElement may be one of any of the supported HTML tags in Internet Explorer, except for FRAME or IFRAME. returns an element unattached to the current document tree. To add the element to the document, use either the or methods. This method will not affect the state of an existing document's source code when you use the control's View Source context menu command or the and properties of the control. When you create new elements with , you will not be able to set certain properties, such as Name. In cases where you need to set the Name attribute, assign them as HTML to the property of another object in the document. Creates a new HtmlElement of the specified HTML tag type. A new element of the specified tag type. The name of the HTML element to create. Property 2.0.0.0 System.String To be added. The default encoding is the encoding the managed HTML Document Object Model (DOM) will attempt to use when the page is initially loaded. This encoding is derived either from Internet Explorer's Encoding settings, or from a META tag embedded within the page. Gets the encoding used by default for the current document. Method 2.0.0.0 System.Void To be added. Removes an event handler from a named event on the HTML DOM. The name of the event you want to cease handling. The managed code that handles the event. Property 2.0.0.0 System.String To be added. By default, two Web pages in different frames are prevented from accessing each other's content using script; even www.microsoft.com and msdn.microsoft.com are, in this instance, considered different domains. To enable cross-frame scripting for pages from the same top-level domain, you can assign a new value to the property. In the pervious URL example, setting to microsoft.com would allow both pages to communicate with one another. Strings assigned to the property must be valid top-level domains. In the previous URL example, you can set to microsoft.com, but not to .com, which would enable any page on the Internet to script a page's contents. You cannot use the property to enable cross-frame scripting for pages accessed using two different protocols. If one frame in your page comes from a Web server (the http:// protocol) and another comes from the file system (the file://) protocol, they will not be able to communicate with one another regardless of the value of the property. Gets or sets the string describing the domain of this document for security purposes. Property 2.0.0.0 System.Object To be added. is a wrapper for the Internet Explorer Document Object Model (DOM), which is written in COM. If you need to access unexposed properties or methods on the underlying COM interfaces, such as IHTMLDocument2, you can use this object to query for them. To use the unmanaged interfaces, import the MSHTML library (mshtml.dll) into your application. However, you can also execute unexposed properties and methods using the IDispatch::Invoke method. Gets the unmanaged interface pointer for this . Property 2.0.0.0 System.String To be added. To be added. Gets or sets the character encoding for this document. 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. Method 2.0.0.0 System.Void exposes a large array of commands for which there are no methods exposed on . Using you can insert new HTML elements, select and format text, and clear any cached authentication credentials. For a full list of commands, see Command Identifiers. Certain commands, such as copy, have return values. In the current implementation of , you cannot obtain a return value from your call. To retrieve return values, use the corresponding unmanaged method on a reference instead. Executes the specified command against the document. The name of the command to execute. Whether or not to show command-specific dialog boxes or message boxes to the user. The value to assign using the command. Not applicable for all commands. Method 2.0.0.0 System.Void Calling will set focus on the control, if the control currently does not have focus. If the document is hosted inside of a FRAME, this method will put focus on that FRAME within the FRAMESET. Sets user input focus on the current document. System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced) Property 2.0.0.0 System.Boolean To be added. To be added. Gets a value indicating whether the document has user input focus. Event 2.0.0.0 System.Windows.Forms.HtmlElementEventHandler For more information about handling events, see Consuming Events. Occurs before focus is given to the document. Property 2.0.0.0 System.Drawing.Color To be added. The type in the dnprdnshort supports an Alpha value, but the HTML DOM does not. Therefore, Alpha will have no effect when assigned to this property. Gets or sets the text color for the document. Property 2.0.0.0 System.Windows.Forms.HtmlElementCollection To be added. An HTML document may have one or more FORM elements with input fields for submitting data back to a server. You can programmatically submit a FORM by obtaining its and calling its Submit method using the method. To add a new FORM to a document, you can either create a new FORM tag as a string, and assign it to the property of an element previously added to the HTML DOM; or you can use the method, set its properties using , and add it as a child of an existing element using . Gets a collection of all of the <FORM> elements in the document. Method 2.0.0.0 System.Windows.Forms.HtmlElement If there are multiple elements in the document with the same ID value, will return the first one it finds. Retrieves a single using the element's ID attribute as a search key. Returns the first object with the same ID attribute as the specified value, or null if the cannot be found. The ID attribute of the element to retrieve. Method 2.0.0.0 System.Windows.Forms.HtmlElement uses client coordinates, in which the upper-left corner of the document is assigned the value (0,0). Client coordinates for the current position of the cursor can be obtained using the property. Retrieves the HTML element located at the specified client coordinates. The at the specified screen location in the document. The x,y position of the element on the screen, relative to the top-left corner of the document. Method 2.0.0.0 System.Windows.Forms.HtmlElementCollection To be added. Retrieve a collection of elements with the specified HTML tag. The collection of elements who tag name is equal to the argument. The name of the HTML tag for the objects you want to retrieve. Method 2.0.0.0 System.Int32 To be added. Retrieves the hash code for this object. An representing an in-memory hash of this object. Property 2.0.0.0 System.Windows.Forms.HtmlElementCollection To be added. returns a collection of objects. To access attributes, such as ALT and SRC, that are not directly exposed by , use the method. To add a new image to a document, either create a new IMG tag as a string, and assign it to the property of an element previously added to the HTML DOM; or use the method, set its properties using , and add it as a child of an existing element using . Gets a collection of all image tags in the document. Method 2.0.0.0 System.Object The underlying type of the object returned by will vary. If the called Active Scripting function returns scalar data, such as a string or an integer, it will be returned as a string. If it returns a script-based object, such as an object created using JScript or VBScript's new operator, it will be of type Object. (You can make calls on such objects by calling and using .) If it returns an HTML DOM element, such as a DIV or a TABLE, it will be of type Object; if you have added a project reference to MSHTML.DLL, however, it will be cast to its specific unmanaged DOM type. You may call any function written in any Active Scripting language installed on the user's computer, including JScript and VBScript. The will do nothing if the user has explicitly turned off script execution in Internet Explorer, or if the current security configuration for the Web page does not allow it. Executes an Active Scripting function defined in an HTML page. The object returned by the Active Scripting call. The name of the script method to invoke. Method 2.0.0.0 System.Object The underlying type of the object returned by will vary. If the called Active Scripting function returns scalar data, such as a string or an integer, it will be returned as a string. If it returns a script-based object, such as an object created using JScript or VBScript's new operator, it will be of type Object. (You can make calls on such objects by calling and using .) If it returns an HTML DOM element, such as a DIV or a TABLE, it will be of type Object; if you have added a project reference to MSHTML.DLL, however, it will be cast to its specific unmanaged DOM type. You may call any function written in any Active Scripting language installed on the user's machine, including JScript and VBScript. This method will do nothing if the user has explicitly turned off script execution in Internet Explorer, or if the current security configuration for the Web page does not allow it. Executes an Active Scripting function defined in an HTML page. The object returned by the Active Scripting call. The name of the script method to invoke. The arguments to pass to the script method. Property 2.0.0.0 System.Drawing.Color To be added. The type in the dnprdnshort supports an Alpha value, but the HTML DOM does not. Therefore, Alpha will have no effect when assigned to this property. Gets or sets the color of hyperlinks. Property 2.0.0.0 System.Windows.Forms.HtmlElementCollection To be added. This collection will contain all links created using the A, LINK, and AREA tags in HTML. The objects contained within this collection encapsulate the unmanaged IHTMLLinkElement interface. To access the properties of the underlying interface safely, use the method. Gets a list of all the hyperlinks within this HTML document. Event 2.0.0.0 System.Windows.Forms.HtmlElementEventHandler For more information about handling events, see Consuming Events. Occurs while focus is leaving a control. Event 2.0.0.0 System.Windows.Forms.HtmlElementEventHandler The event occurs before the event. For more information about handling events, see Consuming Events. Occurs when the user clicks the left mouse button. Event 2.0.0.0 System.Windows.Forms.HtmlElementEventHandler For more information about handling events, see Consuming Events. Occurs when the mouse is no longer hovering over the document. Event 2.0.0.0 System.Windows.Forms.HtmlElementEventHandler For more information about handling events, see Consuming Events. Occurs when the mouse is moved over the document. Event 2.0.0.0 System.Windows.Forms.HtmlElementEventHandler For more information about handling events, Consuming Events. Occurs when the mouse is moved over the document. Event 2.0.0.0 System.Windows.Forms.HtmlElementEventHandler For more information about handling events, see Consuming Events. Occurs when the user releases the left mouse button. Method 2.0.0.0 System.Boolean To be added. Returns a value that indicates whether the specified instances represent the same value. true if the specified instances are equal; otherwise, false. The first instance to compare. The second instance to compare. Method 2.0.0.0 System.Boolean To be added. Returns a value that indicates whether the specified instances do not represent the same value. true if the specified instances are not equal; otherwise, false. The first instance to compare. The second instance to compare. Method 2.0.0.0 System.Windows.Forms.HtmlDocument will clear the previous loaded document, including any associated state, such as variables. It will not cause navigation events in to be raised. always creates a new document in the current window. To open a document in a new window, use the method on the class. Gets a new to use with the method. A new document for writing. Whether the new window's navigation should replace the previous element in the navigation history of the DOM. Property 2.0.0.0 System.Boolean To be added. will not have any value unless it has been set explicitly, either in code or in HTML. Unlike the property on Windows Forms controls, on the managed HTML DOM will not affect the direction of Latin text. Gets or sets the direction of text in the current document. Event 2.0.0.0 System.Windows.Forms.HtmlElementEventHandler The loading of a Web page will halt if program code calls the method of the control. Navigation failures caused by network outages or malfunctioning Web sites will not cause to occur. For more information about handling events, see Consuming Events. Occurs when navigation to another Web page is halted. Property 2.0.0.0 System.String To be added. Use the property to identify the document by way of a human-readable name. Changes to this property will also reflect in the property of the control. Gets or sets the text value of the <TITLE> tag in the current HTML document. Property 2.0.0.0 System.Uri To be added. This property is read-only. To navigate to a new document, use the property on the control. Gets the URL describing the location of this document. Property 2.0.0.0 System.Drawing.Color To be added. The Color type in the dnprdnshort supports an Alpha value, but the HTML DOM does not. Therefore, Alpha will have no effect when assigned to this property. Gets or sets the Color of links to HTML pages that the user has already visited. Property 2.0.0.0 System.Windows.Forms.HtmlWindow To be added. All HTML documents have an HTML DOM object called a window, which can be used to manipulate the screen size of the document and open new windows, as well as access other important objects, such as an . Gets the associated with this document. Method 2.0.0.0 System.Void All calls to should be preceded by a call to , which will clear the current document and all of its variables. Your calls to will create a new HTML document in its place. To change only a specific portion of the document, obtain the appropriate and set its property. It is recommended that you write an entire valid HTML document using the method, including HTML and BODY tags. However, if you write just HTML elements, the Document Object Model (DOM) will supply these elements for you. Writes a new HTML page. The HTML text to write into the document.