Ver Mensaje Individual
  #3 (permalink)  
Antiguo 03/11/2009, 16:55
ALEJOAGUILAR
 
Fecha de Ingreso: noviembre-2009
Mensajes: 3
Antigüedad: 15 años, 3 meses
Puntos: 0
De acuerdo Respuesta: Recorrer Dos list box

Muchas Gracias eperedo tu codigo me fue muy util para poder comenzar a trabajar, Agradesco toda tu colaboracion.

Lo que coloco a continuacion es como me va quedando lo que en realidad necesito, la cuestion ahora es que necesito sacar aparte los items que se encuentran en el listbox1 pero que no se encuentran en el listbox2 y viceversa, como ya dije esto es lo que llevo, si alguien me puede colaborar deverdad se lo agradesco.

Código bv.net:
Ver original
  1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  2.         Label2.Visible = (True)
  3.         For i As Integer = 0 To Me.ListBox1.Items.Count - 1
  4.             For j As Integer = 0 To Me.ListBox2.Items.Count - 1
  5.                 If ListBox1.Items.Item(i) = ListBox2.Items.Item(j) Then
  6.                 Else
  7.                     ListBox4.Items.Add(ListBox1.Items.Item(i))
  8.                 End If
  9.             Next
  10.         Next
  11.         Label10.Text = ListBox4.Items.Count
  12.  
  13.  
  14.         For k As Integer = 0 To Me.ListBox2.Items.Count - 1
  15.             For l As Integer = 0 To Me.ListBox1.Items.Count - 1
  16.                 If Not ListBox2.Items.Item(k) = ListBox1.Items.Item(l) Then
  17.                     ListBox3.Items.Add(ListBox2.Items.Item(k))
  18.                 End If
  19.             Next
  20.         Next
  21.         Label7.Text = ListBox3.Items.Count
  22.  
  23.     End Sub