Table of Contents

TTMSFNCHTMLText Class

Displays plain or HTML-formatted text with inline styling, images, and clickable anchors.

API unit family: TMSFNCHTMLText Inherits from: TTMSFNCCustomControl Implements: ITMSFNCBitmapContainer

Syntax

TTMSFNCHTMLText = class(TTMSFNCCustomControl, ITMSFNCBitmapContainer)

Remarks

Use DisplayHTML to switch between HTML rendering and literal text rendering.

Properties

Name Description
AutoHeight Controls whether automatic sizing may change the control height.
AutoOpenURL Controls whether anchor clicks open their URL automatically when no click handler is assigned.
AutoSize Controls whether the control resizes itself to fit the rendered text.
AutoSizeSpacing Sets extra spacing added around the measured text during automatic sizing.
AutoWidth Controls whether automatic sizing may change the control width.
BitmapContainer Supplies named bitmaps that can be referenced by image tags in the text.
DisplayHTML Controls whether the text is interpreted as supported HTML markup.
Font Defines the base font used to render the text.
HorizontalTextAlign Sets the horizontal alignment of the rendered text inside the text rectangle.
ShadowColor Sets the shadow color used when text shadow rendering is active.
ShadowOffset Sets the text shadow offset in pixels.
Text Contains the plain text or supported HTML markup rendered by the control.
TextIndentMargins Defines the margins applied inside the control before text is rendered.
Trimming Defines how text is shortened when it does not fit in the available rectangle.
URLColor Sets the color used for rendered anchor text.
URLUnderline Controls whether rendered anchor text is underlined.
Version Returns the component version string.
VerticalTextAlign Sets the vertical alignment of the rendered text inside the text rectangle.
WordWrapping Controls whether rendered text wraps onto multiple lines.

Methods

Name Description
DoMouseDown Processes pointer clicks and raises anchor actions when a link is hit.
DoMouseMove Processes pointer movement for anchor hover feedback.
Draw Draws the control content in the specified graphics context.
GetRect Returns the drawable text rectangle after applying the text indent margins.
GetTextRect Calculates the text bounds required for the current content and rendering options.
IsHTML Indicates whether the current text should be parsed as HTML markup.
UpdateControlAfterResize Recalculates the text layout after the control size changes.

Events

Name Description
OnAnchorClick Occurs when the user clicks an anchor in the rendered text.

Used by