Question textbox maxlength

vikna

Member
Joined
Feb 23, 2010
Messages
6
Programming Experience
Beginner
hi,

How do i code in vb.net that the text box can only accept 10 inputs from the user. User can only enter 10 strings.
please help.thank you
 
Well, it is a whole process that needs to happen --

First, you have to determine what are the criteria that says the user is done entering the information in the textbox. Do they click a button, tab out of the field, mouse over some other control.....

Then you need to code in the events associated with the previous action something to track the number of times this event has been called. So you would probably use a Form level integer variable to track the number of times. This is also where you would probably do something with the data (store it, write it out....)

Next you need to determine what happens once the limit has been reached is the textbox just not available (.Enabled = t/f), the data is just not saved, give the user a message....

Putting these all together gives you the limited data entry textbox.

As for code, what have you done so far?
 
Are you talking about a multi-line TextBox that can only have 10 lines, or do you actually means that it can only have 10 characters? I think demausdauth's interpretation is something else again that I wouldn't have thought of but might be what you mean. Your description is simply not detailed enough to know.
 
Back
Top