TextField.Mask Question - Functionality


I initiate the Field on the Open event and I put

If condition then Me.Mask = "99.99.99-999.99" End if

then I have on another field under the text changed event tf1.Text = 6655858

Now the TextChanged event fires and it populates the text field of tf1 but without formatting. I did tried to put the formatting before I put the data in but no change.

It seems that the formatting gets applied only when user types in the Field.

What I can do that when I fetch the data from the database to have the mask active ?


try #'s ?

You’ll have to apply the formatting before you put it into the TextField.

Per http://documentation.xojo.com/index.php/TextEdit.Mask:

It’s not quite as clear as it should be, IMO.

Thanks guys,

Indeed the # worked but now I have another issue my string has to be in the format [quote]99.99.99-999.99[/quote] now by putting [quote]##.##.##-###.##[/quote] in the mast it did the job for me but for one customer which has Belgian locale the [quote].[/quote] becomes [quote],[/quote] which ends up by not allowing the data to be inputed on the text field , for me I have refilled the part [quote]##.##.##-[/quote] but the rest I guess because of the locale it becomes like read only and does not let me to fill the missing part. on my side it works.

Now , how I should override the locale for this only ?

Is there a way for that or I should just replace the [quote].[/quote] with the ASCII version of it ?


I think it worked , I just put a \ in front of the . and it works now , thanks

Just like #, \\ is described in the Language Reference, read there:


You even have the explanation about the decimal character (dot or coma, depending on the OS language settings)

TextEdit is the TextField / TextArea Parent.