Android Question How do I limit the maxlength on a edit box?

Discussion in 'Android Questions' started by davepamn, Jun 15, 2015.

  1. davepamn

    davepamn Active Member Licensed User

    I am looking for a maxlength property to set on a textbox. Is edit box maxlength set by api or by event down character counting?
     
    Last edited: Jun 15, 2015
  2. DonManfred

    DonManfred Expert Licensed User

    event down character counting. There is no api. But maybe there is a library which replaces the normal edittext with a custom one. Maybe you can limit the length with this library.
     
  3. NJDude

    NJDude Expert Licensed User

  4. davepamn

    davepamn Active Member Licensed User

    It seems like an attribute called maxlength should be made available.

    Code:
    Sub txtGrower_TextChanged (Old As String, New As String)

        
    If New.Length>4 Then txtGrower.Text=Old

    end sub
     
  5. lemonisdead

    lemonisdead Well-Known Member Licensed User

    There is a SetLengthFilter in the IME library. Perhaps could it help ?
     
    thedesolatesoul and Erel like this.
Loading...