Skip to main content

TdxCustomLayoutItem.DefaultCaption Property

Specifies the layout element’s default caption.

Declaration

property DefaultCaption: string read; write;

Property Value

Type
string

Remarks

Layout elements created at design time initialize their DefaultCaption property with their CaptionOptions.Text property value loaded from a DFM file. Layout elements created at runtime initialize their DefaultCaption property with an empty string.

A layout element displays the default caption unless its CaptionOptions.Text property value is modified at runtime either programmatically or by an end-user renaming it while in customization mode. If the modified property value doesn’t match the DefaultCaption string, it is considered a new (custom) caption, which is to be persisted with a layout using the Store~/Restore~ method calls. Thus, this property is particularly useful for layout element localization – you can assign the element’s localized caption by using the CaptionOptions.Text property while retaining the default caption in the DefaultCaption property.

To localize the default caption, enclose the code that changes the element’s CaptionOptions.Text property between the layout control’s BeginTranslation and EndTranslation procedure calls. As a result, the newly assigned CaptionOptions.Text property value is automatically copied to the DefaultCaption property.

See Also