Uppercase Textfield

Hello,
Is there a way to Uppercase Textfield during typing ?.
I have XOJO 2015r1 (Desktop).

Thany you for the support.

Sub TextChange() dim i as integer = me.SelStart me.text = Uppercase( me.text ) me.SelStart = i End Sub

or better

Function KeyDown(Key As String) As Boolean Key = UpperCase( Key ) End Function

[quote=170865:@Markus Winter]or better

Function KeyDown(Key As String) As Boolean Key = UpperCase( Key ) End Function [/quote]
Won’t work. Key is not passed ByRef.

me.SelText = UpperCase(Key)
me.SelStart = me.SelStart + Len(Key)
return true

Put a > symbol in the mask property.

Thank you very much Markus, your first solution works very well. :slight_smile:

[quote=170867:@Tim Hare]Won’t work. Key is not passed ByRef.

me.SelText = UpperCase(Key) me.SelStart = me.SelStart + Len(Key) return true [/quote]

Tim’s code works great and will not force the user to make sure they are typing caps, but rather makes the text into caps automatically.

The down side is that it does not allow the delete key to be used. Also the TAB key would not scroll over to the next available text box.

I like Tanner’s suggestion, however the mask has to be >* and not just >

I’d call that major downsides.

However Tanner’s suggestion works best (if you use >* )

Yeah, silly me. Still had my working code active in the TextChange event when I tried the code in the KeyDown event .

Darnation. Not sure what’s the matter with me today. Not enough coffee maybe.

Tanner’s solution works fine.

Use as mask:

for Uppercase
< for lowercase