熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> .NET編程 >> 正文

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

2022-06-13   來源: .NET編程 

  進入 打開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

  代碼已經輸入完畢接下來我們需要運行程序進行測試

  好了程序運行成功此播放器已經具備了最基本的功能感興趣的朋友還可以向程序增加更多的功能

[]  []  


From:http://tw.wingwit.com/Article/program/net/201311/14946.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.