VB listbox

来源:百度知道 编辑:UC知道 时间:2024/07/02 11:33:49
自己做了个简单的播放器 用list控件添加歌曲的列表。
当 play = false 的时候 自动移动到 下一曲播放
list里面怎么移动到当前歌曲的下一首??请给个简单的例子

If List1.ListIndex < List1.ListCount - 1 Then
List1.ListIndex = List1.ListIndex + 1
End If

List1.ListIndex
你说得很不明白

我觉得Play=false 有点不妥!应该在播放按钮事件里添加判断,如果播放停止则list1.list index如果顺序播放,假如开始是第一首,index=0那么下一首index=1.这样来做不是可以么?

If Me.ListBox1.SelectedItems.Count <> 0 Then
If ListBox1.SelectedIndex < ListBox1.Items.Count - 1 Then
ListBox1.SelectedIndex = ListBox1.SelectedIndex + 1
End If
End If

程序发给我 帮你看看 627123012@qq.com

list自动向下移动,这样就可以了
List1.ListIndex = List1.ListIndex + 1

List1.ListIndex = List1.ListIndex + 1