Official Content

Indicates the text to be displayed for a control.

Syntax

control. Caption = Expression

Scope

Generators: .NET, .NET Framework, Angular, Java
Controls: Button, Text Block

Description

The Caption property is used to indicate the text to be displayed for a control (or to obtain the assigned text).

Its value can be set either at design time or runtime.

For values that can be set at design time, see Dynamic Property Values.

At runtime:

  • Any character expression can be assigned to it.
  • It may be used in:
    • The Start event of an object.
    • The Refresh event of an object.
    • User events defined in an object.

Runtime/Design time

This property applies both at runtime and at design time.

Samples

The following rules are defined in a Transaction object:

Form.Caption = 'My Form - Update' if update;
Form.Caption = 'My Form - Delete' if delete;
Form.Caption = 'My Form - Insert' if insert;

In this example, the Form's title will change depending on the current mode (insert, delete, or update).

Last update: April 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant