CheckBox
TsgcHTMLComponent_CheckBox — Delphi, C++ Builder 및 .NET에서 Bootstrap 5 form-check 마크업을 렌더링하는, 레이블과 데이터셋 바인딩을 갖춘 체크박스(또는 토글 스위치) 입력입니다.
TsgcHTMLComponent_CheckBox — Delphi, C++ Builder 및 .NET에서 Bootstrap 5 form-check 마크업을 렌더링하는, 레이블과 데이터셋 바인딩을 갖춘 체크박스(또는 토글 스위치) 입력입니다.
Bootstrap form-check를 내보내는 독립형 부울 입력입니다 — Switch를 켜면 토글로 렌더링됩니다. 이름, 레이블 및 체크 상태를 설정한 다음, HTML 속성을 읽습니다. 형제 격인 Edit, Memo 및 RadioGroup 입력과 같은 유닛에 제공됩니다.
TsgcHTMLComponent_CheckBox
Bootstrap 5 form-check 입력
Delphi, C++ Builder, .NET
Name, Label_ 및 Checked(그리고 선택적으로 Switch)를 설정한 다음, HTML을 읽습니다(또는 TsgcHTMLTemplate_Bootstrap 페이지에 넣습니다).
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
가장 자주 사용하게 되는 멤버.
Name은 필드 이름을, Label_은 보이는 캡션을, CheckBoxID는 요소 id를 설정합니다(기본값은 chk_<Name>).
Checked는 초기 값을 설정하고 Disabled는 컨트롤을 회색으로 처리합니다.
Switch는 동일한 체크박스 의미를 유지하면서 박스를 Bootstrap form-switch 토글로 교체합니다.
DataField와 할당된 DataSource는 현재 레코드의 부울 필드에서 Checked를 설정합니다.
HTML은 입력과 레이블이 있는 form-check 래퍼를 반환합니다. 같은 유닛이 형제 격인 TsgcHTMLComponent_Edit, TsgcHTMLComponent_Memo 및 TsgcHTMLComponent_RadioGroup 입력을 선언합니다.