Xojo2024R1: forcing input to upper case

I need to force user input for certain strings to upper case. I can convert the entered value to upper case using Uppercase() function, however, I wonder if there is a way to make it upper case as the user types in the string. Can someone please help me with this problem?

Btw, I wish Xojo could provide option such as “uppercase only” for the text field.

Try this in the opening event:

me.Style.Value("text-transform") = "uppercase"

You can create an Issue asking for that feature.

Edit: this only changes to uppercase what it shows on the field, you still need to handle to uppercase with your code.

1 Like

Set the ValidationMask property to “>”.

https://documentation.xojo.com/api/user_interface/desktop/desktoptextfield.html#desktoptextfield-format

Do we have that for Web?

1 Like

D’oh!

I always forget to look at the section. No, I don’t see that for Web. Sorry for the noise.

In the openning event of your control add this line

me.Style.Value("text-transform") = "uppercase"

It looks the same as the code I suggested above, no?

1 Like

Should have read the entire thread :frowning:

1 Like

Thank you for your help, I have placed it in the code and tested, works well.

2 Likes