TextField.LimitText

From Xojo Documentation

Property (As Integer )
aTextField.LimitText = newIntegerValue
or
IntegerValue = aTextField.LimitText

Supported for all project types and targets.

The maximum number of characters allowed in the TextField.

Notes

The value of zero does not limit text. LimitText works for normal text entry, copy and paste, and drag and drop.

Sample Code

This code is in the Open event of the control. It prohibits more than the specified number of characters:

Me.LimitText = 10