capitalize edittext

doogal

Member
Licensed User
Longtime User
I have an application that has a textbox that needs to be capitalized. I am using the following: statement:

B4X:
edtMedication.InputType = Bit.Or(edtMedication.InputType, 0x00004001)

This works on my device(Samsung Galaxy S 4G), but on my wifes device(Samsung Galaxy S3) it does not. Can someone tell me why it doesn't. I have also tried the following values from TextView | Android Developers:

0x00001001
0x00002001
0x00004000
0x00004001
0x00008001

none of these work as expected on the Galaxy S3.

Thanks
 

Mahares

Expert
Licensed User
Longtime User
The easiest way I found to do it is to type it any way you want and then do this to convert it and store it as uppercase:
B4X:
edtMedication.Text=edtMedication.Text.ToUpperCase
 
Upvote 0

doogal

Member
Licensed User
Longtime User
Thanks for your reply.

I have a temporary solution:

B4X:
Dim trimstring As String
Dim a As String
a = edtMedication.Text
trimstring = a.SubString2(0,1).ToUpperCase & a.SubString(1).ToLowerCase

I say temporary because this only fixes single line editbox. This doesn't work well with multiline editbox.

I still don't understand why InputType doesn't work on the Galaxy S3.
 
Upvote 0
Top