Skip to main content

TcxCustomTextEditProperties.DisplayFormat Property

Determines the manner in which the editor’s text is formatted when the editor does not have focus.

Declaration

property DisplayFormat: string read; write;

Property Value

Type
string

Remarks

The EditFormat and DisplayFormat properties control the way in which the editor displays its text when the editor is focused (in edit mode) and does not have focus (in display mode), respectively. If the EditFormat property is not specified, you can set the UseDisplayFormatWhenEditing property to True to select DisplayFormat for value formatting in edit mode. That way, you can unify the manner in which values are formatted in both modes, assigning only the DisplayFormat and UseDisplayFormatWhenEditing properties. If you assigned the EditFormat property, the DisplayFormat and UseDisplayFormatWhenEditing property values are ignored in edit mode.

Format strings depend upon the editor’s data type. Refer to the TNumericField.EditFormat property description to learn about numeric data format strings. To learn about date/time value format strings, refer to the SysUtils.DateTimeToString and SysUtils.StrToDate function descriptions.

Note

The cxDBSpinEdit and cxCurrencyEdit editors use the DisplayFormat property to show their editor’s texts. For the cxDBSpinEdit, the default value for its DisplayFormat property is an empty string. For the cxCurrencyEdit, the default value for its DisplayFormat property is specified by the CurrencyFormat property of an object returned by the cxFormatController global function.

You can change the default format by assigning a new format string to the DisplayFormat property. The RestoreDefaults method restores the default value of DisplayFormat along with other properties.

See Also