Skip to main content
Table of Contents

TTMSFNCCheckBox Class

Check box control combining a checkbox widget with optional HTML text label.

API unit family: TMSFNCCheckBox Inherits from: TTMSFNCCustomCheckBox

Syntax

FMX.TMSFNCCheckBox.hppPascalC++
TTMSFNCCheckBox = class(TTMSFNCCustomCheckBox)
class PASCALIMPLEMENTATION TTMSFNCCheckBox : public TTMSFNCCustomCheckBox

Usage examples

Configure checked state

Sets the check box text, initial state, and change handler.

Configure checked statePascalC++
procedure TForm1.ConfigureCheckBox;
begin
  TMSFNCCheckBox1.Text := 'Enable notifications';
  TMSFNCCheckBox1.Checked := True;
  TMSFNCCheckBox1.OnChange := TMSFNCCheckBox1Change;
end;

procedure TForm1.TMSFNCCheckBox1Change(Sender: TObject);
begin
  TMSFNCBadge1.Visible := TMSFNCCheckBox1.Checked;
end;

void __fastcall TForm1::ConfigureCheckBox()
{
  TMSFNCCheckBox1->Text = "Enable notifications";
  TMSFNCCheckBox1->Checked = true;
  TMSFNCCheckBox1->OnChange = TMSFNCCheckBox1Change;
}

void __fastcall TForm1::TMSFNCCheckBox1Change(TObject *Sender)
{
  TMSFNCBadge1->Visible = TMSFNCCheckBox1->Checked;
}

Read the related guide

Use custom check artwork

Assigns a bitmap container and named bitmap for the check widget.

Use custom check artworkPascalC++
procedure TForm1.ConfigureCustomCheckBoxArt;
begin
  TMSFNCCheckBox1.BitmapContainer := TMSFNCBitmapContainer1;
  TMSFNCCheckBox1.BitmapName := 'check-round';
end;

void __fastcall TForm1::ConfigureCustomCheckBoxArt()
{
  TMSFNCCheckBox1->BitmapContainer = TMSFNCBitmapContainer1;
  TMSFNCCheckBox1->BitmapName = "check-round";
}

Read the related guide

Move the check widget

Places the check widget on the right side of the text.

Move the check widgetPascalC++
procedure TForm1.MoveCheckBoxWidget;
begin
  TMSFNCCheckBox1.WidgetPosition := hwpRight;
  TMSFNCCheckBox1.Text := '<b>Required</b> option';
end;

void __fastcall TForm1::MoveCheckBoxWidget()
{
  TMSFNCCheckBox1->WidgetPosition = Fmx::Tmsfnchtmlimagecontainer::hwpRight;
  TMSFNCCheckBox1->Text = "<b>Required</b> option";
}

Read the related guide

Used by