Do While sldpro.Value >= Int(sldpro.Max)'当播放结束时
If List1.List(List1.ListIndex + 1) = "" Then '最后一首
List1.Selected(List1.ListIndex) = False
List1.Selected(0) = True
Else
List1.Selected(List1.ListIndex) = False
List1.Selected(List1.ListIndex + 1) = True
End If
Call stop_Click
Call play_Click '播放
LoopPrivate Sub play_Click()
Dim ret
Dim err
Dim inputfile As String
Dim i, j, flag
Dim pic_f As String
Dim temp As Integer
Dim file_load As String
j = mp3play1.Authorize("ufo2000", "1208686909") '输入注册码和密码
If (j = 0) Then '注册成功则开始执行,每次调用前都需要验证
For i = 0 To List1.ListCount - 1
If List1.Selected(i) = True Then
inputfile = List2.List(i) '若有歌曲将歌曲的地址调出
End If
Next i
If inputfile = "" Then
MsgBox "没有音乐文件"
Else
mp3play1.stop '开始前停止原来的
mp3play1.Close
ret = mp3play1.open(inputfile, "") '装载文件
mp3play1.play '播放文件这是我编的MP3的一段,请问一下为什么我每次都是在歌曲结束后返回到第一首歌了呢?

解决方案 »

  1.   

    If List1.ListIndex>=List1.ListCount - 1 Then '最后一首
    'List1.Selected(List1.ListIndex) = False
    List1.Selected(0) = True
    Else
    'List1.Selected(List1.ListIndex) = False
    List1.Selected(List1.ListIndex + 1) = True
    End If
      

  2.   

    改一下:
    If List1.ListIndex+1>List1.ListCount - 1 Then '最后一首
    'List1.Selected(List1.ListIndex) = False
    List1.Selected(0) = True
    Else
    'List1.Selected(List1.ListIndex) = False
    List1.Selected(List1.ListIndex + 1) = True
    End If
      

  3.   

    Do While sldpro.Value >= Int(sldpro.Max)'当播放结束时
    If List1.ListIndex >= List1.ListCount - 1 Then '最后一首
      List1.ListIndex = -1
    Else
      List1.ListIndex = List1.ListIndex + 1
    End If
    Call stop_Click
    Call play_Click '播放
    LoopPrivate Sub play_Click()
    Dim ret
    Dim err
    Dim inputfile As String
    Dim i, j, flag
    Dim pic_f As String
    Dim temp As Integer
    Dim file_load As String
    j = mp3play1.Authorize("ufo2000", "1208686909") '输入注册码和密码
    If (j = 0) Then '注册成功则开始执行,每次调用前都需要验证inputfile = List1.List(List1.ListIndex) '若有歌曲将歌曲的地址调出If inputfile = "" Then
    MsgBox "没有音乐文件"
    Else
    mp3play1.stop '开始前停止原来的
    mp3play1.Close
    ret = mp3play1.open(inputfile, "") '装载文件
    mp3play1.play '播放文件