Hola, verán, estoy haciendo un programa en visual basic 6 que consiste en encontrar una bebida previamente seleccionando un elemento de tres listas. Por ejemplo:
Lista 1 (jugos) Lista 2 (Vino/licor) Lista 3 (otros)
Al seleccionar un elemento de la lista 1, otro de la lista 2 y uno más de la lista 3 oprimimos el boton generar y después se desplega un texto con el nombre de la bebida y su forma de preparar.
Dentro del boton generar tengo:
Private Sub Command1_Click()
If List1.List = Jugo de Limon and List2.List = Ron and List3.List = azucar Then
Text1.text ("Mojito") text2.text ("preparación")
End If
End Sub
Pero al compilarlo me genera un error. Me podrían indicar cual es mi error?
Prueba con esto
Private Sub Command1_Click()
If (List1.List(List1.ListIndex) = "Jugo de Limon") and (List2.List(List2.ListIndex) = "Ron") and (List3.List(List3.ListIndex) = "azucar") Then
Text1.text = "Mojito"
text2.text = "preparación"
End If
End Sub
Saludos!
Cita de: MCKSys Argentina en 17 Septiembre 2012, 04:37 AM
Prueba con esto
Private Sub Command1_Click()
If (List1.List(List1.ListIndex) = "Jugo de Limon") and (List2.List(List2.ListIndex) = "Ron") and (List3.List(List3.ListIndex) = "azucar") Then
Text1.text = "Mojito"
text2.text = "preparación"
End If
End Sub
Saludos!
Ahora ya funciona. Olvidé por completo la propiedad
ListIndex. Te lo agradezco infinitamente. Saludos