B4A Library extended editText view

Notice! This is obsolete it will no longer developed. There is a better substitute. Look in the Forum at:

TDSLinput (masked extended EditText)​

Name: TDeditTextExt
Type: B4Xlib
Code: B4A
Version: Beta2 -early access-
Lib Name: TDeditTextExt.b4xlib
(C): TechDoc G.Becker, free to use only for forum members

You need to activated this libraries for TDeditTextExt:
Core, AppCompat, IME, JavaObject, XUI,TDeditTextExt

In some situations we need an editText view with horizontal and vertical scrolling capability and extra features. TDeditTextExt is a custom control that is desginerable and it is based on the native editText view..
  • In SingleLine Mode text is scrolled in horizontal direction.
  • In Multiline Mode text is scrolled in vertical and horizontal direction.
In addition of the scrolling possibility TDeditTextExt has this features:
  • Preset and check Input length.
  • Set Input Spellchecking On/Off.
  • Show/Hide a Border (Tint) if the view is focused or not. Set Bordercolor and width.
  • Preset a Mask and check the input against it.
  • Give Access to all native properties of the inbuild editTextView.
To set the properties values by code follow this example:
Set standard or extended properties:
Sub setStandardProperties
End Sub
Sub SetExtendedProperties
    TDeditTextExt1.Mask = "###.##"
End Sub

For the use in the Designer the native editText and the extended properties are shown in the Custom Properties Section (see attached picture).

The minimum input length is 0. If you set the length value every text change the current input length ich ckecked. If you pass the limit the just added character is stripped of.

If SellChecking is True than the phones in build spellchecking is turned on. Wrong or not recognized text is underlind by a red waveline.

IF Tint is True than a border around the view is shown. You are able to set a different color for the focus state and the the border width.

The Mask is usefull and only working if SingleLine property is 'True'.
Use 'A' for Character and '#' for Digit Place like: TDeditTextExt1.Mask = "AA##B" or TDeditTextExt1.Mask = "#,###.##"
Working with a Mask seperator depends on the used editText.InputType.

DECIMAL_NUMBERScomma (,) dot (.)
PHONE( ) + - , . ; / N
TEXT / NONEnot used

If you set a Mask the Input length is set automatically equal to mask length and extended Length property is not used.
If there is an input violation like a not allowed digit or char at the mask/ input position or the input length is less mask length than the background of the view is flashing in red color and an error message is shown. To set the message text and title of the error message use the designer custom properties.

The complete Mask check is started by pressing the ENTER Button at the end of the input. After checking the result is reported by the Event "InputError" to the parent object of TDeditTextExt view.

If you like to look into the TDeditTextExt code please examine the module in the attached example project.

This project is in Beta Status at present. In some situations errors may occure. If you find and error feel free to report them by replying to this article.
If you have ideas or whishes for optimization please let me know.


  • TDeditTextExt.b4xlib
    14.2 KB · Views: 319
  • TDeditTextExt.zip
    403.3 KB · Views: 361
  • CustomProperties.png
    63.8 KB · Views: 526
  • TDeditTextExt.png
    14.3 KB · Views: 539
Last edited: