Solved

edit masks

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

752 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