Skip to main content
Table of Contents

TTMSFNCCheckedListBox.AddItem Method

Adds a checked list box item and returns it.

API unit family: TMSFNCCheckedListBox Declaring type: TTMSFNCCheckedListBox Inherited from: TTMSFNCCustomCheckedListBox

Syntax

FMX.TMSFNCCheckedListBox.hppPascalC++
function AddItem(AText: string = ''): TTMSFNCCheckedListBoxItem; reintroduce; virtual;
HIDESBASE virtual TTMSFNCCheckedListBoxItem* __fastcall AddItem(System::UnicodeString AText = System::UnicodeString());

Parameters

Name Description
AText Initial item text. The default value creates an empty item.

Returns

The newly created checked list box item.

Usage examples

Populate a checked list

Adds options and sets the initial checked state.

Populate a checked listPascalC++
procedure TForm1.ConfigureCheckedListBox;
var
  Item: TTMSFNCCheckedListBoxItem;
begin
  TMSFNCCheckedListBox1.AddItem('PDF export').Checked := True;
  TMSFNCCheckedListBox1.AddItem('Email notification');

  Item := TMSFNCCheckedListBox1.AddItem('Archive copy');
  TMSFNCCheckedListBox1.CheckedItem[Item] := True;
end;

void __fastcall TForm1::ConfigureCheckedListBox()
{
  TTMSFNCCheckedListBoxItem *Item;

  TMSFNCCheckedListBox1->AddItem("PDF export")->Checked = true;
  TMSFNCCheckedListBox1->AddItem("Email notification");

  Item = TMSFNCCheckedListBox1->AddItem("Archive copy");
  TMSFNCCheckedListBox1->CheckedItem[Item] = true;
}

Read the related guide