Preventing the BEEP with MaskEdit

How can I prevent the BEEP when entering a alpha char in a mask edit accepting only digits ?
skylinkaAsked:
Who is Participating?
 
viktornetCommented:
if not key in ['0'..'9'] then
  key := #0;

Regards,
Viktor Ivanov
0
 
skylinkaAuthor Commented:
Thank you. It works.
0
 
viktornetCommented:
you could also add the backspace key so you can delete the numbers if you want... This is the code to try out...

if not key in ['0'..'9', '.', #8] then
  key := #0;

Regards,
Viktor Ivanov
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.