Partager via


MaxLength Property

Specifies the maximum length (in characters) that can be entered in an EditBox or TextBox control. Available at design time and run time.

Control.MaxLength[ = nMaxLength]

Property Values

  • nMaxLength
    The maximum number of characters that can be entered in an edit box or text box. If nMaxLength is set to 0, there is no limit to the number of characters that can be entered into an edit box. The number of characters that can be entered into a text box when nMaxLength is set to 0 is determined by the size of the text box and its data type.

Remarks

Use MaxLength to limit the amount of text a user can enter in an edit box or text box. MaxLength only applies for a text box when MaxLength is greater than 0, the text box does not use the InputMask property, and its Value property is of character type.

See Also

SelLength Property

Applies To: EditBox | TextBox