Solved

edit masks

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

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 Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

809 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