ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

  • The HTML format
  • HTML Edit control
  • Overview
  • Remarks:
  • Defining the content of an HTML Edit control
  • Saving a text in an HTML file
  • Example
  • Saving HTML text to an HFSQL data file item
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
The HTML format
HyperText Markup Language (HTML) is a markup language intended for the web.
WEBDEV allows you to handle text in HTML via the "HTML format" option of the Edit controls and the HTML control.
  • If the HTML text is displayed in a control that does not support HTML, the tags will be displayed.
  • If the text in HTML format is displayed in a control that supports the HTML format, the tags will be automatically interpreted and the text will be formatted accordingly.
Remark: To use HTML Edit controls, Internet Explorer 6 or later must be installed on the computer that runs the application.
HTML Edit control

Overview

The HTML Edit control is used to display and edit HTML text.
The control automatically stores entered text as HTML. This text will contain all the necessary formatting tags.

Remarks:

  • A formatting toolbar can be displayed above the Edit control. This toolbar allows the user to easily format the text entered. For more details, see HTML formatting toolbar.
  • A given string will be longer in an HTML Edit control than in a standard Edit control, because HTML tags are added.
Defining the content of an HTML Edit control
To define the content of an HTML Edit control, simply specify the Value property (in the initialization code of the control, for example).
For example:
// Read an HTML file
HTMLPage is string
HTMLPage = fLoadText(SysDir(srMyDocuments) + ["\"] + "index.html")
 
// Initialize the edit control
EDT_HTMLControl = HTMLPage
Saving a text in an HTML file
HTML formatting is automatically applied to the text entered in an HTML Edit control.
To save the content of an HTML Edit control to an HTML file, simply use fSaveText on the control.

Example

The example below creates an "index.html" file. This file contains the text entered in EDT_HTMLText.
// Select the path and name of the file
FileName is string
FileName = fSelect("", "", "Select a file...", ...
"HTML files" + TAB + "*.html" + CR + "All files (*.*)" + TAB + "*.*", ...
"HTML", fselCreate + fselExist)
 
// Backup
fSaveText(FileName, EDT_HTMLText)

Saving HTML text to an HFSQL data file item

To save HTML text to an item of a data file, it is recommended to bind the Edit control to a Text Memo item.
As HTML includes many tags, "Character string" items are often too small.
Minimum version required
  • Version 15
Comments
Click [Add] to post a comment