awolarczuk
asked on
Limit numbers in a lable
Hi guys i am sure this one is going to be a easy one for you all,
i am using buttons and enter numbers in to a label and i am want to limit and about of numbers that are allowed in the caption, i am wanting it for date so when they are typing in 15 April 1912, it will only allow then to type in two number in the leading caption and 4 in the last one, these are all different captions
i am using buttons and enter numbers in to a label and i am want to limit and about of numbers that are allowed in the caption, i am wanting it for date so when they are typing in 15 April 1912, it will only allow then to type in two number in the leading caption and 4 in the last one, these are all different captions
ASKER
where about do i put the label.maxlength my lable is call day so do i go in the code day.caption = day.caption + 1 and put it in there somewhere
You can go on the form itself and set the property of MaxLength for each label or in your code when you load the form you can set the property in code for example:
day.MaxLength = 2
year.MaxLength = 4
day.MaxLength = 2
year.MaxLength = 4
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
So you could put label.MaxLength = 2
This would limit it to two characters.