LimitText
LimitText
Used to restrict the amount of text entered into the control
Integer property
Applies to: Edit , Grid , GridCell , KCMLEdit , Rich Edit
This property allows the maximum length of a string entered into an edit control to be restricted. It is measured in characters not bytes as the byte count may be larger for UTF-8 or DBCS encodings. For example:
.DbEditControl1.LimitText = 40
The MaxText() text event handler is called, if it exists in the program and is supported by the control, when the text limit set by LimitText property is reached and the character just entered will not fit within the limit. Thus it is called before a character is accepted and not afterwards.
Note that the use of the DataField, or possibly the Type$, property is a much better way of restricting the text that the user enters within a KCML Edit control.