The information in this article applies to:
SUMMARYIn Microsoft Visual Basic for Windows, you can limit the amount of text that can be entered into a text box by calling an internal Windows function and specifying the maximum text limit. However, in Microsoft Visual Basic for MS-DOS, there is no callable function to limit the amount of text entered into a text box. To work around this difference, the text limit can be set by checking the length of the text string in the KeyPress event of that text box and setting the input value, KeyAscii, to zero or null. This method is also compatible with Microsoft Visual Basic version 1.0 for Windows. MORE INFORMATION
To limit text in a text box in Microsoft Visual Basic for MS-DOS, you
must check the length of the text in the text box while in the
KeyPress event procedure. If the length of the text is equal to the
limit you specify, then set KeyAscii to zero. This will effectively
prevent users from entering any more text. Enhancements can be added
to handle backspaces and other characters.
Additional query words: VBmsdos 1.00
Keywords : |
Last Reviewed: December 9, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |