From RAD Studio API Documentation
Jump to: navigation, search



TTextControl = class(TStyledControl, ITextSettings, ICaption, IAcceleratorKeyReceiver)


class PASCALIMPLEMENTATION TTextControl : public TStyledControl


Type Visibility Source Unit Parent
class public
FMX.Controls FMX.Controls


Base class for all text controls such as TDateEdit.

TTextControl is the base class for all graphical controls that display text, such as TTimeEdit, TListBoxItem, TTabItem, and so on.

TTextControl encapsulates standard functionality to manipulate the displayed text, offering the possibility of changing the font, the alignment of the text, or enabling word wrapping.

If you need to create a new control from scratch that displays text (for instance, an enhanced label graphical control or a custom redesigned check box control), then you should derive your component from TTextControl.

TTextControl implements the ITextSettings interface. This interface provides methods and properties to manage the most common text representation properties of general text objects independently of the particular types of these objects. TTextControl and its descendants contain the public property TextSettings of the TTextSettings type. Using the methods and the properties declared in the ITextSettings interface, you can manage the text representation TFont.Family, TFont.Size, TFont.Style, FontColor, HorzAlign, VertAlign, Trimming, and WordWrap properties defining visual parameters of the text representation. For more information, see Setting Text Parameters in FireMonkey.

TTextControl uses the TTextSettingsInfo service class to manage sets of styled text representation properties stored in the DefaultTextSettings, TextSettings, StyledSettings, and ResultingTextSettings properties.

TTextControl implements the IAcceleratorKeyReceiver interface to allow the use of this control as an accelerator key receiver.

See Also