Visual Basic - Reproducir Tema

Life is soft - evento anual de software empresarial
 
Vista:

Reproducir Tema

Publicado por Jose Gpe Sanz (29 intervenciones) el 03/12/2008 18:11:49
Saludos Foro

En mi formulario tengo las siguientes Herramientas
1.- Toolbar
2.- Imagelist
3.- LIst1

Inserte una imagen de un Cantante en un Toolbar con el Imagelist
le agregue los temas que canta
If Button.Index = 1 Then
List1.AddItem ("A Partir de Mañana")
List1.AddItem ("Callejero")
End If

cuando le doy click a la imgen aparecen los temas en un List1
selecciono el primer tema y lo reproduce sin ningun problema
Private Sub List1_Click()
Dim i As Long
Dim sNombreTema$
If List1.ListIndex <> -1 Then
sNombreTema$ = List1.List(List1.ListIndex)
i = ShellExecute(Me.hwnd, "Open", "C:Alberto Cortez_A Partir de Mañana.MP3", "", "C:", 1)
End If

If List1.ListIndex <> -2 Then
sNombreTema$ = List1.List(List1.ListIndex)
i = ShellExecute(Me.hwnd, "Open", "C:Alberto Cortez_Callejero.MP3", "", "C:", 1)
End If

El Problema esta cuando le doy click al segundo tema no me lo reproduce me sigue reproduciendo el primer tema
Pueden ayuarme con esto….?

Gracias por su ayuda
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Reproducir Tema

Publicado por igor (633 intervenciones) el 04/12/2008 21:21:52
Es tan sencillo que ni me molesto en explicarlo.

Private Sub List1_Click()
Dim i As Long
Dim sNombreTema$
select case List1.ListIndex
case 0
sNombreTema$ = List1.List(List1.ListIndex)
i = ShellExecute(Me.hwnd, "Open", "C:Alberto Cortez_A Partir de Mañana.MP3", "", "C:", 1)
case 1
sNombreTema$ = List1.List(List1.ListIndex)
i = ShellExecute(Me.hwnd, "Open", "C:Alberto Cortez_Callejero.MP3", "", "C:", 1)
end select

Si el código que estás modificando no es tuyo te recomiendo que no sigas jugando con fuego.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar