HTML Text Window

Description

Allows you to view and interact with an HTML page, but does not include full browser controls.

Discussion

The HTML Text window allows you to view and interact with an HTML page, but does not include full browser controls. The use of the dhtmledit.dhtmledit ActiveX control allows you to control the text that appears in the page. Refer to {ACTIVEX} and Display an Xdialog Box for more information. This approach to displaying HTML is more powerful but more difficult to use than the Web Browser Window.

Example

dim edit as P
dim edit.object as P
dim edit.class as C
dim edit.events as C
dim shared varC_result as C
dim edit_html as C
edit.class = "dhtmledit.dhtmledit"
edit.events = <<%code%
...
%code%
edit_html = "http://www.alphasoftware.com"
ok_button_label = "&OK"
cancel_button_label = "&Cancel"
varC_result = ui_dlg_box("Browser Window",<<%dlg%
{startup=init}
{region}
| {activex=100,25edit?.f.};
{endregion};
{line=1,0};
{region}
<*15=ok_button_label!OK> <15=cancel_button_label!CANCEL>
{endregion};
%dlg%,<<%code%
if a_dlg_button = "init" then
    edit.object.browsemode = .t.
    edit.object.appearance = 0
    edit.object.ScrollBars = .t.
    on error goto edit_error
    edit.object.LoadURL(edit_html)
    on error goto 0
    edit.object.Refresh()
    a_dlg_button = ""
end if
end
edit_error:
ui_msg_box("Error","Invalid URL or HTML content.",UI_STOP_SYMBOL)
end
%code%)

See Also