Text = "暂停"
Else
AxWindowsMediaPlayer1.Ctlcontrols.play()
Button2.Text = "播放"
End If
End Sub
Private Sub 打开ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 打开ToolStripMenuItem.Click
Button1_Click(sender, e)
End Sub
进入Button3_Click事件
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
AxWindowsMediaPlayer1.Ctlcontrols.stop() '停止
AxWindowsMediaPlayer1.Ctlcontrols.currentPosition() = 0 '重新开始
AxWindowsMediaPlayer1.URL = ""
End Sub
进入 打开ToolStripMenuItem_Click事件
进入打开目录ToolStripMenuItem_Click事件
Private Sub 打开目录ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 打开目录ToolStripMenuItem.Click
If FolderBrowserDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
Dim fi As IO.FileInfo
Dim dir As IO.DirectoryInfo = New IO.DirectoryInfo(FolderBrowserDialog1.SelectedPath)
Dim file As String
For Each fi In dir.GetFiles("*.mp3")
file = fi.FullName
ListBox1.Items.Add(file)
Next
End If
End Sub
进入关闭ToolStripMenuItem_Click事件
Private Sub 关闭ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 关闭ToolStripMenuItem.Click
''关闭
If MessageBox.Show("请确定你要关闭吗?", "关闭", MessageBoxButtons.OKCancel) = Windows.Forms