Private Sub 选择文件ToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles 选择文件ToolStripMenuItem.Click
'设置打开文件对话框的属性
With Me.OpenFileDialog1.Title = "Open Sound File" '对话框标题
.Filter = "mp3文件(*.mp3)|*.mp3|avi文件|*.avi|全部(*.*)|*.*" '文件过滤
.Multiselect = True '允许多选文件
End With
'打开文件选择对话窗口选择取消时则不执行
If OpenFileDialog1.ShowDialog() = DialogResult.Cancel Then
Exit Sub
End If
For Each filename As String In OpenFileDialog1.FileNames
'将选择文件一个一个加入播放器播放列表
AxWindowsMediaPlayer1.currentPlaylist.appendItem(AxWindowsMediaPlayer1.newMedia(filename))
'将选择文件一个一个加入ListBox1列表
Me.ListBox1