Textfield Masking

Hi I’m a complete newbie, but am making my way through this. (Mac OSx with Xojo2013r1)

My question is to do with masking TextFields.
I need to enter a x.xxx value into the TextField. I have tried all the masking options and have had some success, however if I enter for example 1.1 - I would like it to display 1.100 - ie add the missing 0’s if any. I have tried #.000 but that seems to fill in all three 0’s even if I only need one or two.

I have tried the mask view GUI or code and get the same results?
As I side thought the Textfield goes to a Listbox and then Database - so maybe I should edit something in the back end instead to achieve the required result? I would prefer to do it in TextField…

Any assistance would be appreciated as I have trawled all the forums already and cant seem to find any answers.


The actual Cocoa framework has some problems with TextEdit.Mask and Format properties. If you search in Feedback you will find various reports about these features.
Please review the reports and eventually add info if needed.

Set mask to textfield1 to “#.###”

Put the following rough code into the LostFocus event of textfield1:

dim int_loop as int32

for int_loop = len(textfield1.text) to 4
textfield1.text = textfield1.text + “0”
next int_loop

Hi Eric,
Thanks for your prompt reply.
I have tried what you recommend… Good idea, so I will explore that more…
Currently the number still gets passed to the Listbox as x.x and not as x.x00 - and once its passed the TextField has 0000 in it.

Thanks for your help.

Thanks for your advise.
On my Xojo, the Feedback button asked to install the Feedback Software and when prompted again says no Installer.
I will try re install the whole package and see how that goes, but to me the Feedback button does not work as expected.

Thanks again for your help.


Then just download Feedback manually: http://xojo.com/download/extras.php

Thanks… downloading now!