|
|
|
|
|
HTMLEditorFormatSelection (Function) In french: EditeurHTMLFormateSélection Modifies the style of the selected elements in an HTML Editor control. HTMLEditorFormatSelection(HTMEDT_MyHTMLEditor, htmlItalic)
HTMLEditorFormatSelection(HTMEDT_MyHTMLEditor, htmlFontSize, "14px")
Syntax
HTMLEditorFormatSelection(<HTML Editor control> , <Attribute> [, <Value>])
<HTML Editor control>: Control name Name of the HTML Editor control used. <Attribute>: Integer constant Style attribute to modify: | | htmlAlignment | Aligns the selection horizontally. If this constant is used, the <Value> parameter can be used to specify the desired alignment. The possible values are: - chCentre: Selection is centred.
- chRight: Selection aligned to the right.
- chLeft: Selection aligned to the left.
| htmlBackgroundColor | Changes the background color of the selection. If this constant is used, the <Value> parameter can be used to specify the desired background color. The <Value> parameter can correspond to: - an integer. In that case, an RGB color (e.g., returned by RGB) will be used.
- a string. In that case, a color in HTML format (e.g., "00ff00" or "green") will be used.
| htmlBold | Makes the selection bold. If the selection is already bold, the bold formatting will be removed. If part of the selection is bold, the whole selection will be set to bold. | htmlColor | Changes the color of the selection. If this constant is used, the <Value> parameter can be used to specify the desired color. The <Value> parameter can correspond to: - an integer. In that case, an RGB color (e.g., returned by RGB) will be used.
- a string. In that case, a color in HTML format (e.g., "00ff00" or "green") will be used.
| htmlCreateLink | Creates a link to the URL specified in the <Value> parameter. | htmlDeleteLink | Removes the link from the selection. | htmlFontName | Changes the name of the font used for the selection. If this constant is used, the <Value> parameter can be used to specify the font family to use. For example: "Arial, Helvetica, sans-serif". | htmlFontSize | Changes the size of the font used in the selection. If this constant is used, the <Value> parameter can be used to specify the font size to use. This size is expressed in HTML units. For example: "12px" or "2.5em".. | htmlFontSizeDecrease | Reduces the font size of the selection. | htmlFontSizeIncrease | Increases the font size of the selection. | htmlItalic | Italicizes the selection. If the selection is already italicized, the italic formatting will be removed. If part of the selection is italicized, the entire selection will be italicized. | htmlNameCssStyle | Modifies the CSS style used by the selection. If this constant is used, the <Value> parameter can be used to specify the name of the CSS style to use. | htmlStrikeThrough | Crosses out the selection. If the selection is already crossed out, the line will be removed. If part of the selection is crossed out, the entire selection will be crossed out. | htmlSubscript | Applies subscript formatting to the selection. If the subscript formatting has already been applied to the selection, it will be removed. If the subscript formatting has been applied to a part of the selection, it will then be applied to the entire selection | htmlSuperscript | Applies superscript formatting to the selection. If the superscript formatting has already been applied to the selection, it will be removed. If the superscript formatting has been applied to a part of the selection, it will then be applied to the entire selection. | htmlUnderlined | Underlines the selection. If the selection is already underlined, the underline will be removed. If part of the selection is underlined, the entire selection will be underlined. |
<Value>: Optional variant Value to be used depending on the constant used in the <Attribute> parameter. Remarks - After using this function, the "Modify selection" event of the control is automatically executed (unless the function is used in this event).
- The modification is not immediate: you have to wait for the "Selection modification" event to be called before reading back the field value.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|