Defining Control Styles

Use

You can use styles to change the colors of text in a plain text control, based on defined conditions. For example, you may want to display information in red if a quantity is over a certain value, or green if it is below a certain value. If the plain text control is in a table view, you can also define a background color for the table cell that contains the plain text control.

Prerequisites

You have added a plain text control to a form view or table view on the Layout board.

Procedure

  1. On the Layout board, right-click the plain text control whose styles you want to define and choose Styles .

    The Define Styles dialog box is displayed.

  2. Select the Style 1 text and enter a descriptive name for the style.

  3. In the Condition cell of the first row, enter a dynamic expression that defines when to apply the style. To do this, you can click the Define Expression button and use the Dynamic Expression Editor dialog box. For more information, see Working with Dynamic Expressions . Alternatively, you can leave the default condition ( true ) to indicate that the style is always used (not conditional on certain criteria).

  4. If the plain text control is in a table, in the Cell Background cell, choose the color for the cell. The background color that you select is displayed as the background color of the Style cell.

  5. In the Font Style cell, choose the text format. The font style that you select is displayed as the font style of the Style cell.

  6. In the Text Color cell, choose the color for the text. The color that you select is displayed as the text color of the Style cell.

  7. Click the Add Style button and repeat steps 2 to 6 to define additional styles, as required.

  8. Use the Move Up and Move Down buttons to modify the order of the styles. At runtime, the first style in the list whose condition returns true is used.

  9. Click OK .