← Back to Index
TFlexFMXAdvancedHTMLLabel
Label control with support for basic HTML formatting tags.
Key Properties
HTMLText: string
Text with HTML formatting tags.
WordWrap: Boolean
Enable automatic word wrapping (preserves HTML formatting).
TextSettings: TTextSettings
Font family, size, color, and style settings.
AutoSize: Boolean
Automatically adjust height to fit content.
VertTextAlign / HorzTextAlign: TTextAlign
Vertical and horizontal text alignment.
Supported HTML Tags
<b>...</b> - Bold text
<i>...</i> - Italic text
<s>...</s> - Strikethrough text
<font size="XX">...</font> - Custom font size
<br> - Line break
Usage Examples
Basic HTML
Label1.HTMLText := 'This is <b>bold</b> and this is <i>italic</i>.';
Font Sizes
Label1.HTMLText := '<font size="24">Large</font> and <font size="12">small</font>.';
Multi-line with Formatting
Label1.HTMLText := 'Line 1: <b>Important</b><br>' +
'Line 2: <i>Additional info</i><br>' +
'Line 3: <s>Deprecated</s>';
Label1.WordWrap := True;
Mixed Formatting
Label1.HTMLText := 'Status: <b><font size="18">ACTIVE</font></b>';
Events
OnLinkClick - When a clickable link is activated (future feature)
Notes
- HTML parsing preserves formatting across word-wrapped lines
- Nested tags are supported (e.g.,
<b><i>text</i></b>)
- Font size is in pixels
- Unknown tags are ignored and rendered as plain text
- Use for dynamic, formatted text displays
← Back to Index