Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TcxCustomTextEditProperties.MaxLength Property

Specifies the maximum number of characters a user can enter into an editor.

#Declaration

Delphi
property MaxLength: Integer read; write;

#Property Value

Type
Integer

#Remarks

Use the MaxLength property to specify the maximum number of characters a user can enter into an editor. If this property value is 0, no limitations are applied to the length of entered text. If the number of characters already entered equals the MaxLength property value, further text input is ignored.

The default value of the MaxLength property for a data-aware editor is determined by the MaxLength attribute of the dataset field to which this editor is connected (the default value is obtained only for string fields; for other field types the default value is 0). If a user enters and posts a string whose length is greater than the default value of the MaxLength property, the string is truncated.

You can use the RestoreDefaults method to revert to default values of the MaxLength property and other properties retrieved from the related TField object attributes.

Note

The MaxLength property value does not affect the entered text by changing the Text or EditValue property.

See Also