Visual Basic Media Player

Discussion in 'Programming' started by x:Biohazard:x, Jan 3, 2010.

  1. #1
    [size=medium]Visual Basic Media Player[/size]
    I know there is a few tuts on here but i thought i would add my own :thumbsup:
    1. Create a new windows application form project (name it w.e)

    2. You will need to import the necessary media player component so Click Tools then a menu will drop down and click Choose Tool Box Items and go to the Com Components section.
    And scroll all the way down and check the Windows Media Player and then press ok. And the component should be added to your toolbar.
    (Pic)
    [​IMG]

    3. Then from the toolbar add the windows media player to your application. And re size it to your liking.

    4. From your tool bar add an Open File Dialog. And once its added go down to properties and find "Filter" and it should be empty--Paste
    All files (*.*)|*.*
    There which you can customize to your liking.
    EX:
    Mp3 Files (*.mp3)
    That will be the file types it will open so all files will allow ever file type your computer reads

    5. From the toolbar add a button and change the text in it to "Open File" or what ever you want.
    Double click the open button and put in this code
    
    OpenFileDialog1.ShowDialog()
    AxWindowsMediaPlayer1.URL = OpenFileDialog1.FileName
    Code (markup):
    And then debug and your final project should look something like this
    [​IMG]

    Any questions you can pm or post
     
    x:Biohazard:x, Jan 3, 2010 IP