进入 打开ToolStripMenuItem_Click事件
进入打开目录ToolStripMenuItem_Click事件
Private Sub 打开目录ToolStripMenuItem_Click(ByVal sender As SystemObject ByVal e As SystemEventArgs) Handles 打开目录ToolStripMenuItemClick
If FolderBrowserDialogShowDialog = WindowsFormsDialogResultOK Then
Dim fi As IOFileInfo
Dim dir As IODirectoryInfo = New IODirectoryInfo(FolderBrowserDialogSelectedPath)
Dim file As String
For Each fi In dirGetFiles(*mp)
file = fiFullName
ListBoxItemsAdd(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 MessageBoxShow(请确定你要关闭吗? 关闭 MessageBoxButtonsOKCancel) = WindowsFormsDialogResultOK Then
Close()
Else
Return
End If
End Sub
进入Timer_Tick事件
Private Sub Timer
_Tick(ByVal sender As System
Object
ByVal e As System
EventArgs) Handles Timer
Tick
HScrollBarValue = AxWindowsMediaPlayerCtlcontrolscurrentPosition
End Sub
进入HScrollBar_Scroll事件
Private Sub HScrollBar
_Scroll(ByVal sender As System
Object
ByVal e As System
Windows
Forms
ScrollEventArgs) Handles HScrollBar
Scroll
进度条
AxWindowsMediaPlayerCtlcontrolscurrentPosition() = HScrollBarValue
End Sub
进入ListBox_DoubleClick事件
Private Sub ListBox
_DoubleClick(ByVal sender As Object
ByVal e As System
EventArgs) Handles ListBox
DoubleClick
AxWindowsMediaPlayerURL = ListBoxSelectedItemToString
End Sub
代码已经输入完毕接下来我们需要运行程序进行测试
好了程序运行成功此播放器已经具备了最基本的功能感兴趣的朋友还可以向程序增加更多的功能
[] []