If Windows Media Player does not appear in the Components portion of the Toolbox, do the following:
- Right-click within the Toolbox, and then select Choose Items. This opens the Customize Toolboxdialog box.
- On the COM Components tab, select Windows Media Player.If Windows Media Player does not appear in the list, click Browse, and then open Wmp.dll, which should be in the Windows\System32 folder.
- Click OK. The Windows Media Player control will be placed on the current Toolbox tab.
You can now select Windows Media Player in the Toolbox and add it to a form.
Visual Studio gives the Windows Media Player control a default name such as “axWindowsMediaPlayer1”. You may want to change the name to something more easily remembered, such as “Player”.
Adding the Windows Media Player control from the Toolbox also adds references to two libraries created by Visual Studio, AxWMPLib and WMPLib. You can find them in the Solution Explorer under References.
To make using the objects in the Player namespace easier, you should include the namespace in the using or imports directives of your files, as follows:……