TTMSFNCCheckBox Class
Check box control combining a checkbox widget with optional HTML text label.
API unit family: TMSFNCCheckBox
Inherits from: TTMSFNCCustomCheckBox
Syntax
TTMSFNCCheckBox = class(TTMSFNCCustomCheckBox)
class PASCALIMPLEMENTATION TTMSFNCCheckBox : public TTMSFNCCustomCheckBox
Usage examples
Configure checked state
Sets the check box text, initial state, and change handler.
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;
}
Use custom check artwork
Assigns a bitmap container and named bitmap for the check widget.
procedure TForm1.ConfigureCustomCheckBoxArt;
begin
TMSFNCCheckBox1.BitmapContainer := TMSFNCBitmapContainer1;
TMSFNCCheckBox1.BitmapName := 'check-round';
end;
void __fastcall TForm1::ConfigureCustomCheckBoxArt()
{
TMSFNCCheckBox1->BitmapContainer = TMSFNCBitmapContainer1;
TMSFNCCheckBox1->BitmapName = "check-round";
}
Move the check widget
Places the check widget on the right side of the text.
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";
}