Any questions? Ask us:



MaxLength Property

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


Use MaxLength to limit the number of characters that can be entered into the edit control. A value of -1 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 to a value less than the number of characters currently in the edit control causes the edit control to truncate its text to MaxLength characters.