Gets or sets the maximum number of characters the user can type into the control.


object.MaxLength [ = long ]

Property Value

The number of characters that can be entered into the control. The default is zero.


TextBox: When this property is set to zero, the maximum length of the text that can be entered in the control is limited only by available memory. You can use this property to restrict the length of text entered in the control for values such as postal codes and telephone numbers. You can also use this property to restrict the length of text entered when the data is to be entered in a database. You can limit the text entered into the control to the maximum length of the corresponding field in the database.

ComboBox: Limits only the text the user can enter. It has no effect on any text already in the edit control when the property is set, nor does it affect the length of the text copied to the edit control when a string in the list box is selected. The default limit to the text a user can enter in the edit control is 30,000 characters.

See Also

Applies To: ComboBox | TextBox

The CHM file was converted to HTML by chm2web software.