caption

Type: String

Availability: Read or write at any time

For the Form class, the caption property contains the text displayed in the title bar of the form. When the form is minimized, this text is displayed on the task bar.

When you create a new object, its default caption is the same as the default name for both forms and controls. This default caption includes the object name and an integer; for example, text1 or Form1. For a more descriptive label, set the caption property to the required value.

The code fragment in the following example shows the use of the caption property.

caption := caption &  '  -  ' & process.signOnUserCode;

In the Button, CheckBox, JadeDockBase, Form, Frame, GroupBox, JadeMask, Label, MenuItem, OptionButton, Sheet, StatusLine classes, this property can be translated when the value of the Schema class formsManagement property is FormsMngmt_Single_Multi (2).

You can use the caption property to assign an access key to a control or menu.

In the caption, include an ampersand character (&) immediately preceding the character you want for an accelerator (shortcut) key. That character is then underlined.

Press Alt and the underlined character to move the focus to that control. To include an ampersand character in a caption without creating an access key, enter two ampersand characters (&&). A single ampersand is displayed in the caption and no characters are underlined.

The tabIndex property of a control affects its associated accelerator key. If you press the accelerator key for a control that does not have the tab stop ability, the focus moves to the next enabled and visible control in the tab order that can receive the focus.

The maximum length of a caption for a form is 255 characters. The maximum length for controls that have captions is 32,767 characters. The maximum length of a caption for a menu is 100 characters.

If a form has a menu, a Control-Menu icon, or a Maximize or Minimize button, the caption area is always displayed, regardless of whether the caption is empty or not. Alternatively, if the borderStyle property is set to BorderStyle_None (no caption) or the caption is empty, the form does not display the caption area of the form.

When an MDI child form is maximized within an MDI form, the caption of the child form is included with the caption of the parent form.

For a JadeMask control, caption alignment (that is, word wrapping) occurs within the rectangle defined by the captionLeft, captionTop, captionHeight, and captionWidth properties. If the value of the captionWidth property is zero (0), the width of the caption region is the value of the clientWidth property less the value of the captionLeft property. If the value of the captionHeight property is zero (0), the height is the value of the clientHeight property less the value of the captionTop property. The caption is never shown as disabled.

For a Label control, set the autoSize property to true, to automatically resize the control to fit its caption. For a GroupBox control, the caption is displayed in the border that is offset from the top of the control. If there is no caption, the border is drawn as an entire rectangle.

The caption property of the JadeDockBase class determines the caption of the floating form parent of the control. The caption property is not used if the control is not floating.

The default value for the JadeDockBar and JadeDockContainer controls is a null string ("").