Solved

edit masks

Posted on 1998-12-23
3
148 Views
Last Modified: 2010-04-04
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.
0
Comment
Question by:paulah122398
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 12

Expert Comment

by:rwilson032697
ID: 1352807
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
 

Author Comment

by:paulah122398
ID: 1352808
That is not what I wanted to do.  I want to set the component to validate on 6 or 8 characters
0
 
LVL 12

Accepted Solution

by:
rwilson032697 earned 100 total points
ID: 1352809
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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses
Course of the Month10 days, 15 hours left to enroll

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question