Foro de elhacker.net

Programación => Programación Visual Basic => Mensaje iniciado por: guidosl en 4 Abril 2009, 23:55 pm



Título: ayuda con un combobox
Publicado por: guidosl en 4 Abril 2009, 23:55 pm
holaa

queria saber como poder ingresar en un combobox  ejemplo:3 nombre

Martin

maria

julio

y que al seleccionar alguno me ponga en visible un frame y me esconda los otros 2

PD: hay un frame creado para cada nombre

ej: si selecciono martin (el frame1 tiene los datos de martin, esconodo los otros 2 frame)

frame1.visible=true
frame2.visible=false
frame3.visible=false


graciass


Título: Re: ayuda con un combobox
Publicado por: xkiz ™ en 5 Abril 2009, 00:14 am
Código
  1. Private Sub Combo1_Click()
  2. Select Case Combo1.ListIndex
  3. Case 0
  4.    Frame1.Visible = True
  5.    Frame2.Visible = False
  6.    Frame3.Visible = False
  7. Case 1
  8.    Frame1.Visible = False
  9.    Frame2.Visible = True
  10.    Frame3.Visible = False
  11. Case 2
  12.    Frame1.Visible = False
  13.    Frame2.Visible = False
  14.    Frame3.Visible = True
  15. Case Else
  16. End Select
  17. End Sub
  18.  
  19. Private Sub Form_Load()
  20. Combo1.AddItem "Juan"
  21. Combo1.AddItem "Jose"
  22. Combo1.AddItem "Matias"
  23. Combo1.ListIndex = 0
  24. End Sub