進入 打開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 MessageBox
Show(
請確定你要關閉嗎?
關閉
MessageBoxButtons
OKCancel) = Windows
Forms
DialogResult
OK 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
HScrollBar
Value = AxWindowsMediaPlayer
Ctlcontrols
currentPosition
End Sub
進入HScrollBar_Scroll事件
Private Sub HScrollBar
_Scroll(ByVal sender As System
Object
ByVal e As System
Windows
Forms
ScrollEventArgs) Handles HScrollBar
Scroll
進度條
AxWindowsMediaPlayer
Ctlcontrols
currentPosition() = HScrollBar
Value
End Sub
進入ListBox_DoubleClick事件
Private Sub ListBox
_DoubleClick(ByVal sender As Object
ByVal e As System
EventArgs) Handles ListBox
DoubleClick
AxWindowsMediaPlayer
URL = ListBox
SelectedItem
ToString
End Sub
代碼已經輸入完畢接下來我們需要運行程序進行測試
好了程序運行成功此播放器已經具備了最基本的功能感興趣的朋友還可以向程序增加更多的功能
[] []
From:http://tw.wingwit.com/Article/program/net/201311/14946.html