Solved

edit masks

Posted on 1998-12-23
3
144 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
  • 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
delphi prevent click fast 2 238
Reconfigure Delphi Install? 2 60
Create a path if not exists 7 89
Sending files from  idTcpServer Socket to idTcpClient 2 44
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

840 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