Link to home
Start Free TrialLog in
Avatar of Looking_4_Answers
Looking_4_Answers

asked on

TEdit OnKeyPress Event help

I have a function that converts a number to roman and visa versa. (thanks to EE expert).

I need to prevent users from entering anything other than the following characters

0..9, or  I,V,X,L,C,D,M

into a TEdit control

I guess i need to allow a backspace, but nothing else. (example, no spaces, periods, etc. etc)

thanks
Avatar of Looking_4_Answers
Looking_4_Answers

ASKER

sorry, i meant to rephrase it

if not (Key in [#8, '0'..'9', 'I','V','X','L','C','D','M']) then
  Key := #0;

i need to prevent the person from entering a numeric if they are already entering a roman numeral character, and visa versa (if the enter a 'I','V','X','L','C','D','M'  then they can't enter a 0..9
ASKER CERTIFIED SOLUTION
Avatar of Emmanuel PASQUIER
Emmanuel PASQUIER
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Great !
Très bonne idée.
NICE JOB!  Thanks!