This property returns and sets a value that indicates whether there is a maximum number of characters that can be entered in the TextBox control. If there is a maximum number, MaxLength specifies that number.
object.MaxLength [= value]
Use the MaxLength property to limit the number of characters a user can enter in a TextBox.
In double-byte character set (DBCS) systems, each character can take up to two bytes instead of only one, which limits the number of characters you can enter.
If you assign text that exceeds the MaxLength property setting to a TextBox from code, no error occurs. However, only the maximum number of characters are assigned to the Text property, and extra characters are truncated. Changing this property does not affect the current contents of a TextBox, but will affect any subsequent changes to the contents.