Monday, 4 January 2016

Make your own media player using visual studio 2008 using simple code

       Developing media player  like VLc is simple in Microsoft visual studio 2008 just drag and drop the windows Media player in your form

Adding Windowns Media player control in Toolbox

1. Open Microsoft visual studio 2008
2. File->New project
3. Select project type has visual Basic
4. Under visual basic select windows ->windows Form Application in toolbox  must    import Windows Media Player in toolbox. Select any tool and  right-click and select  choose items 

5. it shows choose tool items box select COM components tab



 


    under select the Windows Media Player 
6. click OK  and paste paste Windows Media player in your  form
7. paste button and openfile dialogbox in  your form using your open file dialog and select file and load file to windows Media Player.

8. double clik your  button  paste the following code

      OpenFileDialog1.ShowDialog()
          AxWindowsMediaPlayer1.URL = OpenFileDialog1.FileName

Debug your coding.

Download


Coding:

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Open.Click
        OpenFileDialog1.ShowDialog()
        AxWindowsMediaPlayer1.URL = OpenFileDialog1.FileName


    End Sub
End Class



Output screen: