'将ListBOX控件的MultiSelect属性设置为单选(运行时不能设置,只能在设计时设置好)
'事先在ListBOX控件中选中一个文件并开始播放
private sub List1_click()
WindowsMediaPlayer1.URL=List1.List(List1.ListIndex)
WindowsMediaPlayer1.controls.play '播放当前选择的文件
end sub
private sub UpPlay_click()'单击向上按钮
WindowsMediaPlayer1.controls.pause
WindowsMediaPlayer1.controls.stop
List1.Selected(List1.ListIndex-1)=true
WindowsMediaPlayer1.URL=List1.List(List1.ListIndex)
WindowsMediaPlayer1.controls.play '播放上一个文件
end sub
private sub DownPlay_click()'单击向下按钮
WindowsMediaPlayer1.controls.pause
WindowsMediaPlayer1.controls.stop
List1.Selected(List1.ListIndex+1)=true
WindowsMediaPlayer1.URL=List1.List(List1.ListIndex)
WindowsMediaPlayer1.controls.play '播放下一个文件
end sub