FMX.Controls.TTextControl.Text

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property Text: string read GetText write SetText stored TextStored;

C++

__property System::UnicodeString Text = {read=GetText, write=SetText, stored=TextStored};

Properties

Type Visibility Source Unit Parent
property public
FMX.Controls.pas
FMX.Controls.hpp
FMX.Controls TTextControl

Description

Specifies the text that will be rendered over the surface of this TTextControl object.

Set the Text property to specify the text that will be displayed by this TTextControl. Text can be any string.

If there are any effects already applied before changing the Text property, they will be preserved for the new text. Also, the surface of this TTextControl is repainted.

In the Text property you can define an accelerator key. On Windows platforms, an accelerator key is shown as an underlined letter. To specify an accelerator key, precede an <accelerator_letter> with an ampersand & character. The letter after the ampersand appears underlined. For example, to set the S character as an accelerator key for a Save button, type &Save. On Windows platforms, accelerator keys enable the user to access controls pressing Alt+<accelerator_letter> key combination. When run on not Windows platforms, a single ampersand is simply stripped from the text. To show a single ampersand & character in a Text property specify doubled ampersand && characters.

Tip: If you specify a new text string that is exactly the same as the one already displayed, the effects will not be re-updated and this TTextControl object will not be repainted.
Note: FMX.ExtCtrls.TPopupBox.Text is not a writable property in the same way as FMX.Controls.TTextControl.Text. The FMX.ExtCtrls.TPopupBox.Text property cannot be "any string", but instead must be just one of the strings in the FMX.ExtCtrls.TPopupBox.Items property and, in this case, FMX.ExtCtrls.TPopupBox.ItemIndex is updated accordingly.

See Also

Code Examples