1.- diseñamos nuestro formulario
button agregar
Private Sub agregar_Click(sender As Object, e As EventArgs) Handles Button5.Click
'lista
1
Me.ListBox1.Items.Add(TextBox1.Text)
TextBox1.Text = ""
TextBox2.Text = ListBox1.Items.Count
'lista
2
TextBox3.Text = ListBox2.Items.Count
End Sub
button <<
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
ListBox1.Items.AddRange(ListBox2.Items)
ListBox2.Items.Clear()
actualizar()
End Sub
button >
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
For i = 0 To
ListBox1.SelectedItems.Count - 1
ListBox2.Items.Add(ListBox1.SelectedItems(i))
ListBox1.Items.Remove(ListBox1.SelectedItems(i))
Next
actualizar()
End Sub
cuenta los datos del control
Sub actualizar()
TextBox2.Text = ListBox1.Items.Count
TextBox3.Text = ListBox2.Items.Count
End Sub
button <
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
For i = 0 To
ListBox2.SelectedItems.Count - 1
ListBox1.Items.Add(ListBox2.SelectedItems(i))
ListBox2.Items.Remove(ListBox2.SelectedItems(i))
Next
actualizar()
End Sub
button >>
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
ListBox2.Items.AddRange(ListBox1.Items)
ListBox1.Items.Clear()
actualizar()
End Sub
Eso seria todo espero haber ayudado
dudas y sugerencias dejanos tu comentario
Excelente.
ResponderEliminar