Ver Mensaje Individual
  #1 (permalink)  
Antiguo 09/04/2007, 12:34
rosemary22
 
Fecha de Ingreso: agosto-2005
Mensajes: 36
Antigüedad: 18 años, 8 meses
Puntos: 0
ayuda con listbox y comboBox

hola les agradeceria q me ayuden
el problema q tengo es sobre un comBobox q me muestra 3 opciones ....cada opcion contiene 3 elementos....estos elementos sean de mostrar en mi listbox1 ...por medio de un boton voy pasando el elemento q seleccione de mi listbox1 al listbox2 ...hasta ahi no tengo problemas.....eso si me sale....pero lo q yo quiero es q al volver a selecionar alguna opcion de mi combobox no aparesca el elemento q ya pase a mi listbox2 x medio del boton .........en mi listbox1
Este es el codigo...e.spero q me ayuden les agradeceria un monton ...

Cita:
Public Class Form11
Private Sub Form11_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub

Private Sub cbSeleccion_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbSeleccion.SelectedIndexChanged
If cbSeleccion.SelectedIndex > -1 Then

Select Case cbSeleccion.Text

Case "Peru"
ListBox1.Items.Clear()
ListBox1.Items.Add("Farfan")
ListBox1.Items.Add("Pizarro")
ListBox1.Items.Add("Solano")



Case "Argentina"
ListBox1.Items.Clear()
ListBox1.Items.Add("Colotto")
ListBox1.Items.Add("Rodriguez")
ListBox1.Items.Add("Saviola")


Case "Brasil"
ListBox1.Items.Clear()
ListBox1.Items.Add("Lucio")
ListBox1.Items.Add("Caca")
ListBox1.Items.Add("Capo")


End Select

End If

End Sub

Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
End Sub

Private Sub ListBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox2.SelectedIndexChanged
End Sub

Private Sub btnDer_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDer.Click

If ListBox1.SelectedIndex >= 0 Then 'Verifico si esta seleccionado un items
ListBox2.Items.Add(ListBox1.SelectedItem)
ListBox1.Items.Remove(ListBox1.SelectedItem)

Else
MsgBox("No has selecionado ningun ITEMS.....!!!!")
End If
End Sub
End Class