VB6 beginners tutorial - Learn VB6

Advanced VB6 tutorial - Learn Advanced VB6

Systems Analysis - System analysis and Design tutorial for Software Engineering

You are here: Visual Basic > Advanced VB6 tutorial > Chapter 5

MaxLength and Data-Bound Properties in Visual Basic 6

The following properties will save you the work of writing validation code since they will automatically enforce certain data-entry constraints on the user.


The TextBox control's MaxLength property allows you to specify the maximum number of characters that the user can enter into a TextBox. If the user tries to enter more than the maximum allowed, then the input is ignored.

If you set MaxLength's value to 0 (its default value), then there is no maximum length and the user can enter as many characters as desired (up to the 32K limit on the Text property's size).

Data-Bound Properties

These properties are only useful when the controls to which they belong are bound to data:

  • DataChanged is a property that allows the programmer to distinguish between changes made to a bound control's contents by the underlying data engine (caused by data navigation or updates from other users) versus changes made in the application by users or program code.

  • DataFormat allows the programmer to specify a mask for formatting data when it is retrieved from and stored to the underlying data structure.

See Also


<< Previous | Contents | Next (Chapter 6) >>

Home | About Us | Privacy Policy | Contact Us

Copyright © | All Rights Reserved