CheckBox

TsgcHTMLComponent_CheckBox — Delphi, C++ Builder 및 .NET에서 Bootstrap 5 form-check 마크업을 렌더링하는, 레이블과 데이터셋 바인딩을 갖춘 체크박스(또는 토글 스위치) 입력입니다.

TsgcHTMLComponent_CheckBox

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_MemoTsgcHTMLComponent_RadioGroup 입력을 선언합니다.

계속 살펴보기

모든 sgcHTML 컴포넌트60개 이상의 컴포넌트 전체 기능 매트릭스를 둘러보십시오.
무료 체험판 다운로드30일 체험판에는 60.HTML 데모 프로젝트가 포함됩니다.
가격전체 소스 코드가 포함된 Single, Team 및 Site 라이선스.

시작할 준비가 되셨습니까?

무료 체험판을 다운로드하고 Delphi, C++ Builder 및 .NET에서 웹 UI를 구축하기 시작하십시오.