TListBox * lbx2; //обьявил локально if (??????) { //если компонент такой сущесвует (lbx2) или если выделена память for (int j(0); j < lbx2 - > Items - > Count; j++) { tstn[j] - > Release(); Application - > ProcessMessages(); } lbx2 - > Clear(); } else { //либо создаем такой компонент lsbx = new TStringList(GridLayout2); lbx2 = new TListBox(GridLayout2); } That's what substitute where the question marks?
lbx2 != nullptr? - user194374