I'm using VC++ and 2 listboxs, i need to transfer the items from the first listbox to the second. i used this code but it only transfer the 1st item repeated as much as the first listbox contains items (the items count) :
for (int x = 0; x < Listbox1->Items->Count; x++)
{
Listbox1->SetSelected(x, true);
String^ curItem = Listbox1->SelectedItem->ToString();
listBox2->Items->Add(curItem);
std::string str = msclr::interop::marshal_as<std::string>(curItem);
cv::Mat img = cv::imread(str, 1);
cv::imshow("ShowImage", img);
cvWaitKey(5000);
}
I have to do an auto-selection of the items