Play mp3,mid,... files on VB 2010!
First Of all We need to add a reference to the windows media player (wmp.dll).
1. Go to Project -> Add Reference (see tut1.png)
2. A Window Should Pop Up, now go to the COM tab and scroll all th way down them just search for Windows Media player
(see tut2.png), then when you found the wmp.dll just select and press OK.
3. Now Go to the toolbox and scroll down till you reach the General Section, inside the general press the right button and selec "Choose Items..."
(see tut3.png)
4. Now go to the COM Components tab and scroll down a bit till you find the Windows Media Player, Select it and Press OK.
(see tut4.png)
5. Now just drag the Windows Media Player Object in the ToolBox(see tut5.png)
and put it anywhere in the form, select the object and go to properties and set "visible" to false.
(see tut6.png)
6. Now you need to include the music file you want into the project simply, drag the file and place it inside the project.
(see tut7.png)
7. Now go to the properties from the file you just putted inside the project and change the "Copy to Output" option to "Copy Always".
(see tut8.png)
8. Then Finaly just copy this code on the disered Sub:
AxWindowsMediaPlayer1.URL = <name of the file>
Example:
AxWindowsMediaPlayer1.URL = "Promisses.mp3"
(see tut9.png)
Leave your comments...
Thanks Barata.
First Of all We need to add a reference to the windows media player (wmp.dll).
1. Go to Project -> Add Reference (see tut1.png)
2. A Window Should Pop Up, now go to the COM tab and scroll all th way down them just search for Windows Media player
(see tut2.png), then when you found the wmp.dll just select and press OK.
3. Now Go to the toolbox and scroll down till you reach the General Section, inside the general press the right button and selec "Choose Items..."
(see tut3.png)
4. Now go to the COM Components tab and scroll down a bit till you find the Windows Media Player, Select it and Press OK.
(see tut4.png)
5. Now just drag the Windows Media Player Object in the ToolBox(see tut5.png)
and put it anywhere in the form, select the object and go to properties and set "visible" to false.
(see tut6.png)
6. Now you need to include the music file you want into the project simply, drag the file and place it inside the project.
(see tut7.png)
7. Now go to the properties from the file you just putted inside the project and change the "Copy to Output" option to "Copy Always".
(see tut8.png)
8. Then Finaly just copy this code on the disered Sub:
AxWindowsMediaPlayer1.URL = <name of the file>
Example:
AxWindowsMediaPlayer1.URL = "Promisses.mp3"
(see tut9.png)
Leave your comments...
Thanks Barata.