用什么方法使axwindowsmediaplayer的播放列表与listbox中的列表联动
如题
Dim i, j As Integer
Private Sub ListBox1_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBox1.DoubleClick
AxWindowsMediaPlayer1.currentPlaylist.clear()
For j = 0 To i Step 1
AxWindowsMediaPlayer1.currentPlaylist.appendItem(AxWindowsMediaPlayer1.newMedia(ListBox1.Items.Item(j).ToString))
Next
AxWindowsMediaPlayer1.URL = ListBox1.SelectedItem
End Sub
Private Sub AxWindowsMediaPlayer1_DoubleClickEvent(ByVal sender As Object, ByVal e As AxWMPLib._WMPOCXEvents_DoubleClickEvent) Handles AxWindowsMediaPlayer1.DoubleClickEvent
FolderBrowserDialog1.ShowDialog()
ListBox1.Items.Clear()
ListBox1.Items.AddRange(IO.Directory.GetFiles(FolderBrowserDialog1.SelectedPath))
i = ListBox1.Items.Count - 1
'MsgBox(ListBox1.Items.Item(i))
AxWindowsMediaPlayer1.currentPlaylist.clear()
For j = 0 To i Step 1
AxWindowsMediaPlayer1.currentPlaylist.appendItem(AxWindowsMediaPlayer1.newMedia(ListBox1.Items.Item(j).ToString))
Next
End Sub
我想实现:
当播放器的播放列表发生改变时,listbox中的项目相应发生改变
且当listbox的当前选中项发生改变时,播放器的当前选中项也发生相应改变
求大侠指点一二