There are two ways to add Windows Media Player to a WinForms project. However, the second method didn’t work for me:
Using the Toolbox:
- Right-click the Toolbox in Visual Studio and select Choose Items.
- In the COM tab, locate and add the Windows Media Player component.
- Drag the component onto the WinForm. This will automatically add the required references to the project.
Manually Adding a Reference (did not work in my case):
- Right-click the References folder in the project tree and select Add Reference.
- Go to the COM tab, find and select Windows Media Player, and add it to the project.