B4X Store

ELEVATEUI · B4A · XUI

UISwitch

Capture immediate on/off settings with a visual toggle.

78 modules 1,780 APIs

Inputs & forms

What it solves

Capture immediate on/off settings with a visual toggle.

Animated conceptual demonstration, not an exact Android control screenshot.

16 methods8 Designer1 events

When to use this module

In a data-entry form, connect the chosen value to validation and the action that submits the form.

Before integrating, examine its methods, events and Designer options.

B4A integration examples

Tutorials are based on existing project examples or audited APIs. Check each example’s prerequisites; B4A compilation is not claimed.

Practical tutorial awaiting verification

The public API, events and properties remain available. An isolated initialization is not presented as a full example; a tutorial will be added after a functional sequence is documented.

Public methods reference

16 audited signatures

Public Sub Initialize (Callback As Object, EventName As String)

Prepare the instance before its other methods.

Original catalog note: Initializes the component with the callback object and event name.

Callback As ObjectEventName As String
Public Sub DesignerCreateView (Base As Object, Lbl As Label, Props As Map)

Invoked automatically by the B4A Visual Designer; do not call manually.

Original catalog note: Creates the view in the designer with the given properties.

Base As ObjectLbl As LabelProps As Map
public Sub AddToParent(Parent As B4XView, l As Int, t As Int, w As Int, h As Int,isChecked As Boolean,ColorActive As Int,DisableColor As Int, Text As String,TextColor As Int,TextSize As Int, isTextbold As Boolean)

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Parent As B4XViewl As Intt As Intw As Inth As IntisChecked As BooleanColorActive As IntDisableColor As IntText As StringTextColor As IntTextSize As IntisTextbold As Boolean
public Sub setIcons(font As B4XFont,ActiveIcon As Char,DisableIcon As Char)

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

font As B4XFontActiveIcon As CharDisableIcon As Char
Public Sub setText(text As String)

Update text at runtime when this setting changes.

Original catalog note: Sets the text of the label next to the checkbox.

text As String
Public Sub getText As String

Read the current text value for validation or UI synchronization.

Original catalog note: Returns the text of the label next to the checkbox.

Returns: String

Public Sub setTextColor(color As Int)

Update text color at runtime when this setting changes.

Original catalog note: Sets the text color of the label next to the checkbox.

color As Int
Public Sub getTextColor As Int

Read the current text color value for validation or UI synchronization.

Original catalog note: Returns the text color of the label next to the checkbox.

Returns: Int

Public Sub setChecked(b_checked As Boolean)

Update checked at runtime when this setting changes.

Original catalog note: Sets the checked state of the checkbox.

b_checked As Boolean
Public Sub getChecked As Boolean

Read the current checked value for validation or UI synchronization.

Original catalog note: Returns the checked state of the checkbox.

Returns: Boolean

Public Sub setTextFont(font As B4XFont)

Update text font at runtime when this setting changes.

Original catalog note: Sets the font of the label next to the checkbox.

font As B4XFont
Public Sub getTextFont As B4XFont

Read the current text font value for validation or UI synchronization.

Original catalog note: Returns the font of the label next to the checkbox.

Returns: B4XFont

Sub setIconsize(size As Float)

Update iconsize at runtime when this setting changes.

Original catalog note: Sets the size of the icon.

size As Float
Sub getIconsize As Float

Read the current iconsize value for validation or UI synchronization.

Original catalog note: Returns the size of the icon.

Returns: Float

Public Sub setEnabled(enabled As Boolean)

Update enabled at runtime when this setting changes.

Original catalog note: Enables or disables the component.

enabled As Boolean
Public Sub getEnabled As Boolean

Read the current enabled value for validation or UI synchronization.

Original catalog note: Returns whether the component is enabled or not.

Returns: Boolean

Designer · 8

#DesignerProperty: Key: ActiveColor, DisplayName: ActiveColor, FieldType: Color, DefaultValue: 0xFFE3BE81, Description: Active color#DesignerProperty: Key: DisableColor, DisplayName: DisableColor, FieldType: Color, DefaultValue: 0xFF7A8194, Description: Disable color#DesignerProperty: Key: Checked, DisplayName: Checked, FieldType: Boolean, DefaultValue: False, Description: Checked#DesignerProperty: Key: Text, DisplayName: Text, FieldType: String, DefaultValue:#DesignerProperty: Key: TextColor, DisplayName: Text Color, FieldType: Color, DefaultValue: 0xFF000000#DesignerProperty: Key: TextFontSize, DisplayName: Text Font Size, FieldType: Float, DefaultValue: 16.0#DesignerProperty: Key: TextBold, DisplayName: Text Bold, FieldType: Boolean, DefaultValue: False#DesignerProperty: Key: IconSize, DisplayName: Text Icon Size, FieldType: Float, DefaultValue: 16.0

Public events and how to implement them · 1

Initialize with Me and the event prefix Demo, then add the following handler to your B4A module. Names and arguments come from the library declaration.

CheckedChange(Checked As Boolean)

Raised when a selection or value changes; use it to update dependent data.

B4A handler signature with Demo prefix

Private Sub Demo_CheckedChange(Checked As Boolean)
    Log("CheckedChange")
End Sub

For code-created controls use Initialize(Me, "Demo") when that signature exists; for Designer controls set the event name there. Replace Demo with the actual prefix.

Public fields, constants and types

Public mBase As B4XViewPublic Tag As Object
Source: ElevateUI public API catalog; tutorials cross-checked against ElevateUI(6).b4xlib. Visualizations are illustrative; sample code requires B4A compilation.