Filter what the user types

Hello,
I’m having trouble making a filter for a textbox.
my textbox can only accept coordinates in this way +33:33:33, -33:33:33

How can I create a filter to avoid a mistake in writing?

thanks,
Rui

Here are some options:

  • try using TextField.Mask: http://documentation.xojo.com/index.php/TextEdit.Mask
  • add code to the TextField.KeyDown event handler and track what has been typed and make sure it fits your format
  • use the TextField.TextChanged and TextField.Text property to check what has been typed after the fact

Thanks Paul, is a great help :slight_smile:

Rui

hey Paul,

in TextEdit.Mask manual no find way to accept the symbol more and less.
I’m doing this way TextField3.Mask = “?##:##:##, ?##:##:##”

found TextField3.Mask = “&##:##:##, &##:##:##”

thanks,
Rui