edit masks

In paradox when you wanted to limit the information a user was able to enter, you could apply a picture.  I want to duplicate this in Delphi and have had no luck.  I can get the first part of it to work but am stumped on the rest.
I have a field that will be 10-0xxxx.  (x being any number)I need to add to that there could be a condition where the field would be 10-0xxxx-x.  I would like to know how to get the - to appear only when there is something behind it.  Using the editmask in the fields editor modifies the data so that they all include the -.  I am using Delphi 3/4 and Interbase 5.1.  Any help would be appreciated.
paulah122398Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
rwilson032697Connect With a Mentor Commented:
OK, Add an OnKeyPress event handler to the control. At each keypress check the length of the entered string. if it is 6 already (they are about to add a 7th) change the edit mask to the 8 char one...

Cheers,

Raymond.
0
 
rwilson032697Commented:
Use two edit masks and assigned the appropriate one to the edit mask edit control when you know which one will be used.

Cheers,

Raymond.
0
 
paulah122398Author Commented:
That is not what I wanted to do.  I want to set the component to validate on 6 or 8 characters
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.