A) Check toolbox. If you can find Windows Media Player componet skip this step and continue. Else do the following:
1. Right-click within the Toolbox, and then select Choose Items. This opens the Customize Toolbox dialog box.
2. 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.
3. Click OK. The Windows Media Player control will be placed on the current Toolbox tab.
B) Select Windows Media PLayer component from toolbox and add it to your form.
C) Select the Windows Media Player control in your form, then change the uiMode property to "none". This setting hides the UI controls. When the user plays a video, it will appear in the window.
D) Double Click the "Play" Button to see its code window.
E) Add below code to the event of play button:
axWindowsMediaPlayer1.URL = @"c:\mediafile.wmv";
Where "c:\mediafile.wmv" is a placeholder for the name of the media item you want to play.
F) And to add the stop code, double click on stop button and add the followinfg code:
axWindowsMediaPlayer1.Ctlcontrols.stop();
No matter what type of file you want to play. You just need to set the url of windows media player component to your file. For example:
axWindowsMediaPlayer1.URL = @"c:\Music.mp3";