Android Question Maxlength properties in Edit Text

anallie0

Active Member
Licensed User
Longtime User
hi to all

There is a simple way to set a defined length in a Edit Text. (max n° of characters)
in vb6 there was text.maxlength properties.

thanks
 

anallie0

Active Member
Licensed User
Longtime User
does not work

B4X:
Sub textnome_TextChanged (Old As String, New As String)

If New.Length > 21 Then textnome.Text = Old
  
End Sub

so it works
 
Upvote 0

mangojack

Expert
Licensed User
Longtime User
you might wish to see post #5 Here ...

it should be ..
B4X:
If New.Length > 20 Then textnome.Text = New.Substring2(0, 20)
 
Upvote 0
Top