RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TMemo.MaxLength Property

Specifies the maximum number of characters the user can enter into the edit control.

Pascal
property MaxLength: Integer;
C++
__property int MaxLength;

Use MaxLength to limit the number of characters that can be entered into the edit control. A value of 0 indicates that there is no application-defined limit on the length. 

Use MaxLength to limit the length of the text in an edit control if that text will be copied into a fixed-length buffer.

Note: Setting MaxLength will not truncate the existing text, it merely prevents the user from adding more text after reaching the limit of MaxLength characters.
Note: Even when MaxLength is 0, there may be limitations imposed by the operating system on the number of characters that may be entered into an edit control.
Note: The unit of MaxLength is characters (not bytes) if the application is using themes.
 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!