Link to home
Start Free TrialLog in
Avatar of awolarczuk
awolarczukFlag for Australia

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
Avatar of ltlbearand3
ltlbearand3
Flag of United States of America image

Use MaxLength

So you could put label.MaxLength = 2

This would limit it to two characters.
Avatar of awolarczuk

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
ASKER CERTIFIED SOLUTION
Avatar of jkaios
jkaios
Flag of Marshall Islands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial