Control : HTML
![]()
The HTML control displays a Web page from a URL, HTML , or XML text.

Contents |
Overview
Use the HTML control to display a URL, HTML, or XML inside a form.
Capabilities
You can use the HTML control to:
- Display a URL. By default, the Path Type property is set to URL. Bind the HTML control to a field containing a URL to display the Web page for that URL.
- Display HTML text. Set the Path Type property to HTML and bind the control to a field containing HTML text.
- Display XML text. Set the Path Type property to XML and bind the control to a field containing XML text.
Limitations
Requirements
Examples
Example 1: Display Web Page from URL (Ex1_SimpleURL)
This example shows how to use the HTML control to display a Web page from a URL.
A Label control and an HTML control are both bound to string url. The label displays the URL as text and the HTML control displays the actual Web page pointed to by the URL. The Path Type property (Behavior tab) is set to URL (the default).
Example 2: Display HTML (Ex2_HTMLWithContent)
This example shows how to use the HTML control to display HTML text.
A RichTextEdit control and an HTML control are both bound to string content. When first run, the HTML control displays the default HTML content in content. Use the RichTextEdit control to change the text. When you click the save icon in the RichTextEdit control, the changes are displayed in the HTML control.
The Path Type property (Behavior tab) is set to HTML.
Note To display XML text, set the Path Type property to XML instead of HTML.
Example 3: Display HTML from Resource List (Ex3_ResourceList)
This example shows how to display HTML text that is a resource item.
A collection (Collection(ResourceItem) resources) contains the resource objects (of type ResourceItem). Each resource item contains HTML code. When you click on an item in the List control, the HTMLViewerAdapter identifies the resource to be displayed.
The Path Type property (Behavior tab) is set to HTML.
Example Helper Class ResourceItem
The helper class (ResourceItem) contains the HTML code that is selected by the List control in Example 3.
Reference
Supported Types (Control Interface)
| Type | Summary |
|---|---|
| string |
Use the HTML control to display a string in the form of a URL, HTML, or XML. |



