B4X Store

ELEVATEUI · B4A · XUI

UICheckbox

Capture an independent yes/no choice, including form consent or settings.

78 modules 1,780 APIs

Inputs & forms

What it solves

Capture an independent yes/no choice, including form consent or settings.

Animated conceptual demonstration, not an exact Android control screenshot.

40 methods15 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

40 audited signatures

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

Prepare the instance before its other methods.

Original catalog note: Initializes the control

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

Base As ObjectLbl As LabelProps As Map
Public Sub AddToParent(Parent As B4XView, Left As Int, Top As Int, Width As Int, Height As Int, CornerRadius As Int, Checked As Boolean, Text As String)

Add this view to a parent container using the supplied bounds and options.

Original catalog note: Adds the control to a parent view

Parent As B4XViewLeft As IntTop As IntWidth As IntHeight As IntCornerRadius As IntChecked As BooleanText As String
Public Sub CreateFieldsetGroup(Parent As B4XView, Left As Int, Top As Int, Width As Int, Height As Int, GroupTitle As String) As B4XView

Use CreateFieldsetGroup for its named operation; follow its exact signature.

Original catalog note: Static Helper to Create Fieldset Container with Legend Label around Checkboxes

Parent As B4XViewLeft As IntTop As IntWidth As IntHeight As IntGroupTitle As String

Returns: B4XView

Public Sub SetIndeterminate(Indeterminate As Boolean)

Use SetIndeterminate for its named operation; follow its exact signature.

Original catalog note: Set Indeterminate State (dash icon)

Indeterminate As Boolean
Public Sub setUncheckedBackgroundColor(Color As Int)

Update unchecked background color at runtime when this setting changes.

Original catalog note: Set Custom Unchecked Background Color

Color As Int
Public Sub Base_Resize (Width As Double, Height As Double)

Use Base_Resize for its named operation; follow its exact signature.

Original catalog note: Resizes the control

Width As DoubleHeight As Double
Public Sub setText(Text As String)

Update text at runtime when this setting changes.

Original catalog note: Sets the text of the control

Text As String
Public Sub getText As String

Read the current text value for validation or UI synchronization.

Original catalog note: Gets the text of the control

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 control

Color As Int
Public Sub getTextColor As Int

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

Original catalog note: Gets the text color of the control

Returns: Int

Public Sub setChecked(Checked As Boolean)

Update checked at runtime when this setting changes.

Original catalog note: Sets the checked state of the control

Checked As Boolean
Public Sub getChecked As Boolean

Read the current checked value for validation or UI synchronization.

Original catalog note: Gets the checked state of the control

Returns: Boolean

Public Sub setTextFontType(Font As B4XFont)

Update text font type at runtime when this setting changes.

Original catalog note: Sets the font type of the text

Font As B4XFont
Public Sub getTextFontType As B4XFont

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

Original catalog note: Gets the font type of the text

Returns: B4XFont

Public Sub setIconSize(Size As Float)

Update icon size at runtime when this setting changes.

Original catalog note: Sets the icon size

Size As Float
Public Sub getIconSize As Float

Read the current icon size value for validation or UI synchronization.

Original catalog note: Gets the icon size

Returns: Float

Public Sub SetIcon(Icon As String, Font As B4XFont)

Use SetIcon for its named operation; follow its exact signature.

Original catalog note: Sets the icon for the control

Icon As StringFont As B4XFont
Public Sub SetImage(FileDir As String, FileName As String, KeepAspectRatio As Boolean)

Use SetImage for its named operation; follow its exact signature.

Original catalog note: Sets an image for the control

FileDir As StringFileName As StringKeepAspectRatio As Boolean
Public Sub setBorderCornerRadius(Radius As Int)

Update border corner radius at runtime when this setting changes.

Original catalog note: Sets the border corner radius

Radius As Int
Public Sub setBorderWidth(Width As Int)

Update border width at runtime when this setting changes.

Original catalog note: Sets the border width

Width As Int
Public Sub getIconColor As Int

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

Original catalog note: Gets the icon color

Returns: Int

Public Sub setIconColor(Color As Int)

Update icon color at runtime when this setting changes.

Original catalog note: Sets the icon color

Color As Int
Public Sub setCheckedBackgroundColor(Color As Int)

Update checked background color at runtime when this setting changes.

Original catalog note: Sets the checked background color

Color As Int
Public Sub getCheckedBackgroundColor As Int

Read the current checked background color value for validation or UI synchronization.

Returns: Int

Public Sub setCheckedAnimated(Animated As Boolean)

Update checked animated at runtime when this setting changes.

Original catalog note: Sets whether the check state is animated

Animated As Boolean
Public Sub setEnabled(Enable As Boolean)

Update enabled at runtime when this setting changes.

Original catalog note: Sets whether the control is enabled

Enable As Boolean
Public Sub getEnabled As Boolean

Read the current enabled value for validation or UI synchronization.

Original catalog note: Gets whether the control is enabled

Returns: Boolean

Public Sub getDisabledBackgroundColor As Int

Read the current disabled background color value for validation or UI synchronization.

Original catalog note: Gets the disabled background color

Returns: Int

Public Sub setDisabledBackgroundColor(Color As Int)

Update disabled background color at runtime when this setting changes.

Original catalog note: Sets the disabled background color

Color As Int
Public Sub getDisabledIconColor As Int

Read the current disabled icon color value for validation or UI synchronization.

Original catalog note: Gets the disabled icon color

Returns: Int

Public Sub setDisabledIconColor(Color As Int)

Update disabled icon color at runtime when this setting changes.

Original catalog note: Sets the disabled icon color

Color As Int
Public Sub getIsHaptic As Boolean

Read the current is haptic value for validation or UI synchronization.

Original catalog note: Gets whether haptic feedback is enabled

Returns: Boolean

Public Sub setIsHaptic(Enabled As Boolean)

Update is haptic at runtime when this setting changes.

Original catalog note: Sets whether haptic feedback is enabled

Enabled As Boolean
Public Sub getIsEvent As Boolean

Read the current is event value for validation or UI synchronization.

Original catalog note: Gets whether events are enabled

Returns: Boolean

Public Sub setIsEvent(Enabled As Boolean)

Update is event at runtime when this setting changes.

Original catalog note: Sets whether events are enabled

Enabled As Boolean
Public Sub setTextFontSize(FontSize As Float)

Update text font size at runtime when this setting changes.

Original catalog note: Sets the text font size

FontSize As Float
Public Sub setTextBold(Bold As Boolean)

Update text bold at runtime when this setting changes.

Original catalog note: Sets whether the text is bold

Bold As Boolean
Public Sub getTextFontSize As Float

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

Original catalog note: Gets the text font size

Returns: Float

Public Sub getTextBold As Boolean

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

Original catalog note: Gets whether the text is bold

Returns: Boolean

Designer · 15

#DesignerProperty: Key: CheckedBackgroundColor, DisplayName: Checked Background Color, FieldType: Color, DefaultValue: 0xFF60A7C6#DesignerProperty: Key: IconColor, DisplayName: Icon Color, FieldType: Color, DefaultValue: 0xFFFFFFFF#DesignerProperty: Key: IconSize, DisplayName: Icon Size, FieldType: Float, DefaultValue: 22, MinRange: 8.0, Description: Size of the icon in pixels.#DesignerProperty: Key: DisabledBackgroundColor, DisplayName: Disabled Background Color, FieldType: Color, DefaultValue: 0x80969292#DesignerProperty: Key: DisabledIconColor, DisplayName: Disabled Icon Color, FieldType: Color, DefaultValue: 0x98FFFFFF#DesignerProperty: Key: BorderWidth, DisplayName: Border Width, FieldType: Int, DefaultValue: 5, MinRange: 1#DesignerProperty: Key: BorderCornerRadius, DisplayName: Border Corner Radius, FieldType: Int, DefaultValue: 10, MinRange: 0#DesignerProperty: Key: CheckedAnimated, DisplayName: Checked Animated, FieldType: Boolean, DefaultValue: True#DesignerProperty: Key: HapticFeedback, DisplayName: Haptic Feedback, FieldType: Boolean, DefaultValue: True, Description: Whether to make a haptic feedback when the user clicks on the control.#DesignerProperty: Key: Checked, DisplayName: Checked, FieldType: Boolean, DefaultValue: False#DesignerProperty: Key: Enabled, DisplayName: Enabled, FieldType: Boolean, DefaultValue: True#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#DesignerProperty: Key: TextBold, DisplayName: Text Bold, FieldType: Boolean, DefaultValue: False

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 B4XView ' Base viewPublic Tag As Object ' Tag for the viewPublic LabelPosition As String = "RIGHT" ' "RIGHT" (Position Start) or "LEFT" (Position End)
Source: ElevateUI public API catalog; tutorials cross-checked against ElevateUI(6).b4xlib. Visualizations are illustrative; sample code requires B4A compilation.