I have TCheckListBox
and when it is checked I save the options in an Array. I need to click on a "List" button, Array elements (marked options of TCheckListBox
) are listed in TListBox
.
It should look something like this:
For this we will go through all TCheckListBox
looking for the marked items, and we will add one by one in TListBox
.
Following procedure:
void __fastcall frmTeste::btnTesteClick(TObject *Sender)
{
ListBox1->Clear(); //Limpando a Lista
for (int i = 0; i < CheckListBox1->Count; i++)
{
if (CheckListBox1->Checked[i]) //Para cada 1 que estiver maarcado...
ListBox1->Items->Add(CheckListBox1->Items->Strings[i]); //...Adiciona na lista
}
}