You are here: User interface > Controls > Standard controls > Specifying the caption for a Button control

Specifying the caption for a Button control

Using a caption for a Button control makes it easier for application users to understand the button's purpose and to complete their tasks.

Localization considerations

When you plan to localize the application that includes this Button control, limit the caption's text length to 64 characters. A field value rule with pyButtonLabel as the second key part and this text as the final key part is needed for each locale. When practical, choose a caption that is already included in a language pack, to simplify later localization.

Prerequisite: Add a Button control to a layout.

  1. On the General tab of the Properties panel, set the Button caption option to one of the following settings:

  2. Optional: To make it possible for users to execute a button's activity by using shortcut keys, include an ampersand (&) immediately before a letter in the caption text to designate that letter as the shortcut key.

    For example, enter &History as the caption text to allow application users to press ALT + h to access work item history.

  3. If your application includes non-autogenerated sections that reference buttons using the ampersand shortcut technique, you must revise the section to include the following JavaScript line:

    pega.u.d. processAccessKeysOnClient = true

    If the sections are part of a harness, you can reference a JavaScript function containing the above line on the Scripts & styles tab of the Harness form.