CheckBox
TsgcHTMLComponent_CheckBox — a checkbox (or toggle switch) input with a label and dataset binding that renders Bootstrap 5 form-check markup, in Delphi, C++ Builder and .NET.
TsgcHTMLComponent_CheckBox — a checkbox (or toggle switch) input with a label and dataset binding that renders Bootstrap 5 form-check markup, in Delphi, C++ Builder and .NET.
A standalone boolean input that emits a Bootstrap form-check — flip Switch to render it as a toggle. Set the name, label and checked state, then read the HTML property. It ships in the same unit as the sibling Edit, Memo and RadioGroup inputs.
TsgcHTMLComponent_CheckBox
Bootstrap 5 form-check input
Delphi, C++ Builder, .NET
Set Name, Label_ and Checked (and optionally Switch), then read HTML (or drop it into a TsgcHTMLTemplate_Bootstrap page).
uses
sgcHTML_Component_Edit;
var
oCheck: TsgcHTMLComponent_CheckBox;
begin
oCheck := TsgcHTMLComponent_CheckBox.Create(nil);
try
oCheck.Name := 'newsletter';
oCheck.Label_ := 'Subscribe to the newsletter';
oCheck.Checked := True;
oCheck.Switch := True; // render as a toggle switch
WebModule.Response := oCheck.HTML; // Bootstrap form-check
finally
oCheck.Free;
end;
end;
// Or bind it to a boolean dataset field:
oCheck.DataField := 'Active';
oCheck.DataSource := dsCustomer;
// includes: sgcHTML_Component_Edit.hpp
TsgcHTMLComponent_CheckBox *oCheck = new TsgcHTMLComponent_CheckBox(NULL);
try
{
oCheck->Name = "newsletter";
oCheck->Label_ = "Subscribe to the newsletter";
oCheck->Checked = true;
oCheck->Switch = true; // render as a toggle switch
String html = oCheck->HTML; // Bootstrap form-check
}
__finally
{
delete oCheck;
}
using esegece.sgcWebSockets;
var check = new TsgcHTMLComponent_CheckBox();
check.Name = "newsletter";
check.Label_ = "Subscribe to the newsletter";
check.Checked = true;
check.Switch = true; // render as a toggle switch
string html = check.HTML; // Bootstrap form-check
The members you reach for most often.
Name sets the field name, Label_ the visible caption and CheckBoxID the element id (defaults to chk_<Name>).
Checked sets the initial value and Disabled greys the control out.
Switch swaps the box for a Bootstrap form-switch toggle while keeping the same checkbox semantics.
DataField plus an assigned DataSource sets Checked from the current record's boolean field.
HTML returns the form-check wrapper with its input and label. The same unit declares the sibling TsgcHTMLComponent_Edit, TsgcHTMLComponent_Memo and TsgcHTMLComponent_RadioGroup inputs.