Ver Mensaje Individual
  #2  
Antiguo 06-06-2007
Avatar de roman
roman roman is offline
Moderador
 
Registrado: may 2003
Ubicación: Ciudad de México
Posts: 20.269
Reputación: 10
roman Es un diamante en brutoroman Es un diamante en brutoroman Es un diamante en bruto
Creo que no hay necesidad de recorrer todos los elementos cada vez:

Código Delphi [-]
procedure TForm1.CheckListBox1ClickCheck(Sender: TObject);
var
  Index: Integer;
  Item: String;

begin
  Index := CheckListBox1.ItemIndex;
  Item := CheckListBox1.Items[Index];

  if CheckListBox1.Checked[Index] then
    ListBox1.Items.Add(Item)
  else
  begin
    Index := ListBox1.Items.IndexOf(Item);
    ListBox1.Items.Delete(Index);
  end;
end;

En este ejemplo, el listbox contendrá los elementos del checklistbx que estén marcados.

// Saludos
Responder Con Cita