This is my first attempt to create a library Please be kind :)

This allows you to make a label with tiny indicator on left which can be turned on or off (with any choice of color)

Usage instructions:
- Download the ledlabel.jar & xml and put it in the B4X additional library folder
- Add reference to LEDLabel
- Add LEDLabel with the designer.


Example and Library are attached. Request for source if you need.
Have only checked for b4a.
Uses xui library.
Feedback welcome.


    5.5 KB · Views: 163
    5 KB · Views: 170


Active Member
Licensed User

Version 1.2

- code optimization to prevent crashes with "loadlayout" method
- method gettext added
- method "enabled" renamed to isTurnedON to avoid confusion with default item "enabled"
- example updated with adding LEDLabels to xCustomListView with random thickness, roundness and turnedon state

M Mohsin
Version: 1.2
  • LEDLabel
    • mbase As anywheresoftware.b4a.objects.B4XViewWrapper
    • tag As Object
    • Methods:
    • IsInitialized As boolean
      Tests whether the object has been initialized.
    • gettext As String
    • gettextsize As int
    • initialize (ba As anywheresoftware.b4a.BA, Callback As Object, EventName As String) As String
    • isturnedon As boolean
    • setroundness (val As int) As String
    • settext (txt As String) As String
    • settextsize (txtsize As int) As String
    • setthickness (thik As int) As String
    • turnedon (NewValue As boolean) As String
    • Properties:
    • text As String
    • textsize As int


    6.2 KB · Views: 140
    4.9 KB · Views: 134

Gabino A. de la Gala

Active Member
Licensed User
Longtime User
IDEA: What about to can define a click event?. Could be used like a beatifull button or swicht...

Gabino A. de la Gala

Active Member
Licensed User
Longtime User
An example of "LEDSwicht":

Private Sub clv_ItemClick (Index As Int, Value As Object)
    Dim l As LEDLabel
    l = clv.GetPanel(Index).GetView(0).tag
End Sub

Gabino A. de la Gala

Active Member
Licensed User
Longtime User
Hello again.
I have already achieved the desired effect by making the LEDLabel act as a Swicht, but much more beautiful and customizable.
The only thing I have had to do is put it inside a panel and activate the click event of the panel and change the state of the LEDLabel each time that event occurs.
Anyway, I think if you could put it directly on the LEDLabel it would make it much more versatile.
Thank you for your work.

Private Sub Panel1_Click
End Sub