HTMLViewer.LoadPage

From Xojo Documentation
Jump to: navigation, search
Method

HTMLViewer.LoadPage(Source As String, RelativeTo As FolderItem)

Loads source (a String containing HTML) into the HTMLViewer. RelativeTo is a file (not a folder) used for resolving links and temporary files.

Notes

Any links will be resolved relative to the passed RelativeTo FolderItem.

On Windows, temporary files are created beside the passed RelativeTo FolderItem. If the temporary files cannot be created, then an exception error may be thrown. This can happen, for example, if you are trying to write to a read-only volume or you don't have write permissions.

Example

In this example, the raw HTML is in a TextArea:

Dim f As FolderItem = GetTemporaryFolderItem
HTMLViewer1.LoadPage(TextArea1.Text, f)


Method

HTMLViewer.LoadPage(File as FolderItem)

Loads the the supplied File into the HTMLViewer. File must be an actual file and not a folder.

Example

This example loads an HTML file from disk. The file type has been added using the File Types Set Editor:

Dim f As FolderItem

f = GetOpenFolderItem("text/html")
If f <> Nil Then
HTMLViewer1.LoadPage(f)
End If
Personal tools
Namespaces

Variants
Actions
Main
Content
Starting Out
Dig Deeper
More Help
Toolbox
About