Im trying to add items left from a ListBox1 to ListBox2 preventing duplicate,I got the code from my question Prevent duplicate items in list box and combo box in Inno Setup? (works perfect passing one by one) and i whant to pass all items at this time pressing button ">>" (pass items left on ListBox1 to ListBox2 (no clone list box)).
here's the code:
procedure botonDerechaTodos(Sender: TObject);
begin
if (listBoxMonedasDisponibles.ItemIndex >= 0)then
begin
if listBoxMonedasSecundarias.Items.IndexOf(listBoxMonedasDisponibles.Items[listBoxMonedasDisponibles.ItemIndex]) < 0 then
listBoxMonedasSecundarias.Items.Add(listBoxMonedasDisponibles.Items[listBoxMonedasDisponibles.Items]);
listBoxMonedasDisponibles.Items.Delete(listBoxMonedasDisponibles.Items);
comboBoxMonedaPrincipal.Items := listBoxMonedasSecundarias.Items;
comboBoxMonedaPrincipal.ItemIndex := 0;
listBoxMonedasSecundarias.ItemIndex := 0;
end;
end;