A box that shows data such as text, numbers, dates, or currency.

Description

A label shows data that you specify as a literal string of text, which appears exactly the way you type it, or as a formula that evaluates to a string of text. Labels often appear outside of any other control (such as a banner that identifies a screen), as a label that identifies another control (such as a rating or audio control), or in a gallery to show a specific type of information about an item.

Key properties

AutoHeight – Set to true to allow the label to auto-grow its height to show all text configurated. Set to false to truncate the text to the height assigned.

Color – The color of text in a control.

Font – The name of the family of fonts in which text appears.

Text – Text that appears on a control or that the user types into a control.

DelayOutput – Set to true to delay action during text input.

Additional properties

Align – The location of text in relation to the horizontal center of its control.

AutoHeight – Whether a label automatically increases its Height property if its Text property contains more characters than the control can show at one time.

BorderColor – The color of a control's border.

BorderStyle – Whether a control's border is Solid, Dashed, Dotted, or None.

BorderThickness – The thickness of a control's border.

Disabled – Whether the user can interact with the control.

DisabledBorderColor – The color of a control's border if the control's Disabled property is set to true.

DisabledColor – The color of text in a control if its Disabled property is set to true.

DisabledFill – The background color of a control if its Disabled property is set to true.

Fill – The background color of a control.

FontWeight – The weight of the text in a control: Bold, Semibold, Normal, or Lighter.

Height – The distance between a control's top and bottom edges.

HoverBorderColor – The color of a control's border when the user keeps the mouse pointer on that control.

HoverColor – The color of the text in a control when the user keeps the mouse pointer on it.

HoverFill – The background color of a control when the user keeps the mouse pointer on it.

Italic – Whether the text in a control is italic.

LineHeight – The distance between, for example, lines of text or items in a list.

OnSelect – How the app responds when the user taps or clicks a control.

Overflow – Whether a scrollbar appears in a label if its Wrap property is set to true and the value of the control's Text property contains more characters than the control can show at one time.

PaddingBottom – The distance between text in a control and the bottom edge of that control.

PaddingLeft – The distance between text in a control and the left edge of that control.

PaddingRight – The distance between text in a control and the right edge of that control.

PaddingTop – The distance between text in a control and the top edge of that control.

PressedBorderColor – The color of a control's border when the user taps or clicks that control.

PressedColor – The color of text in a control when the user taps or clicks that control.

PressedFill – The background color of a control when the user taps or clicks that control.

Size – The font size of the text that appears on a control.

Strikethrough – Whether a line appears through the text that appears on a control.

Tooltip – Explanatory text that appears when the user hovers over a control.

Underline – Whether a line appears under the text that appears on a control.

VerticalAlign – The location of text on a control in relation to the vertical center of that control.

Visible – Whether a control appears or is hidden.

Width – The distance between a control's left and right edges.

Wrap – Whether text that's too long to fit in a label wraps to the next line.

X – The distance between the left edge of a control and the left edge of its parent container (screen if no parent container).

Y – The distance between the top edge of a control and the top edge of the parent container (screen if no parent container).

Related functions

Text( Number, "FormatCodes" )

Examples

Show a literal string

Show the result of a formula

  • Add a label, and set its Text property to a formula such as this one:
    Today()

    Note: When you specify a formula, you don't use quotation marks unless an argument of the formula is a literal string. In that case, enclose the argument, not the formula, in double quotation marks.

    Want more information about the Today function or other functions?

Show data in a gallery

In this procedure, you'll create a collection, called CityPopulations, that contains data about the population of various cities in Europe. Next, you'll show that data in a gallery that contains three labels, and you'll specify the type of data that each label will show.

  1. Add a button, and set its OnSelect property to this formula:
    ClearCollect(CityPopulations, {City:"London", Country:"United Kingdom", Population:8615000}, {City:"Berlin", Country:"Germany", Population:3562000}, {City:"Madrid", Country:"Spain", Population:3165000}, {City:"Rome", Country:"Italy", Population:2874000}, {City:"Paris", Country:"France", Population:2273000}, {City:"Hamburg", Country:"Germany", Population:1760000}, {City:"Barcelona", Country:"Spain", Population:1602000}, {City:"Munich", Country:"Germany", Population:1494000}, {City:"Milan", Country:"Italy", Population:1344000})

  2. Press F5, select the button, and then press Esc.

  3. Add a text gallery, and set its Items property to CityPopulations.

    When the gallery is selected, the right pane shows options for that gallery.

  4. In the Gallery1 pane, set the top list to Population, set the middle list to City, and set the bottom list to Country.