How to Use WMP Control on Vb.Net
- 1). Click the Windows "Start" icon on the task bar, select "Programs" and "Microsoft Visual Basic" to execute the VB.Net development environment.
- 2). Select "File" and "New Project" on the menu bar to start a new VB.Net application. Select the icon labeled "Windows Forms Application" and click the "OK" button.
- 3). Select "Project" and "Add Reference" to open the dialogue box labeled "Add Reference." Select the tab labeled "Com," "Windows Media Player" and click the "OK" button.
- 4). Press the "Ctrl," "Alt" and "X" keys to open the toolbox pane. Double-click on the "Windows Media Player" entry, creating an instance of the media player in the window labeled "Form1."
- 5). Click on the bottom right edge of the Windows Media Player object on "Form1." Move your mouse down and to the right, increasing the size of the media player.
- 6). Double-click on the "Button" icon in the toolbox pane, creating a button object on "Form1"
- 7). Double-click on the "Button1" object in "Form1" and type the following command, changing the text "C:\test.mp3" to the location of your MP3 file:
AxWindowsMediaPlayer1.URL = "C:\test.mp3" - 8). Press the "F5" key to start the VB.Net application in debug mode. Click on the button labeled "Button1" to play the MP3 file using the Windows Media Player in your application.