vb.net

位置:IT落伍者 >> vb.net >> 浏览文章

用VB.net2008打造你的影音播放器[2]


发布日期:2019年06月25日
 
用VB.net2008打造你的影音播放器[2]

进入 打开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 SystemObject ByVal e As SystemEventArgs) Handles 关闭ToolStripMenuItemClick

关闭

If MessageBoxShow(请确定你要关闭吗? 关闭 MessageBoxButtonsOKCancel) = WindowsFormsDialogResultOK Then

Close()

Else

Return

End If

End Sub

进入Timer_Tick事件

Private Sub Timer_Tick(ByVal sender As SystemObject ByVal e As SystemEventArgs) Handles TimerTick

HScrollBarValue = AxWindowsMediaPlayerCtlcontrolscurrentPosition

End Sub

进入HScrollBar_Scroll事件

Private Sub HScrollBar_Scroll(ByVal sender As SystemObject ByVal e As SystemWindowsFormsScrollEventArgs) Handles HScrollBarScroll

进度条

AxWindowsMediaPlayerCtlcontrolscurrentPosition() = HScrollBarValue

End Sub

进入ListBox_DoubleClick事件

Private Sub ListBox_DoubleClick(ByVal sender As Object ByVal e As SystemEventArgs) Handles ListBoxDoubleClick

AxWindowsMediaPlayerURL = ListBoxSelectedItemToString

End Sub

代码已经输入完毕接下来我们需要运行程序进行测试

好了程序运行成功此播放器已经具备了最基本的功能感兴趣的朋友还可以向程序增加更多的功能

[] []

               

上一篇:用VB.net2008打造你的影音播放器[1]

下一篇:VB.net编码规范