Thursday, 22 November 2012

Media Player Using C Sharp:


Media Player Using C Sharp:

Step 1:
           Open a new Windows form Application Project.
Step 2:
      Go to Toolbox and drag Menu Strip to your Form.


Step 3:
  Go to Tool box and Drag an Open File Dialog to your Form.

Step 4:
Click anywhere on toolbox and click Choose items…


Step 5:
           You will see Choose Toolbox Items  Dialog opened
            Click on COM Components.



Step 6:
          Select Windows Media player from the list and Click OK.



Step 7:
            Now Windows Media player has been added to your toolbox items.

Step 8:
            Search Windows Media Player in toolbox and drag it to your Form.
            



 

                  It should look like this.

Step 9:
             Give some text to your Menus as shown.

              Now double Click on Open.


Step 10:
             Now Type the following code under the open sub_menu.

            openFileDialog1.InitialDirectory = "C:";
            openFileDialog1.FileName = "";
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                axWindowsMediaPlayer1.URL = openFileDialog1.FileName;
            }
            else
            {
                MessageBox.Show("Canceled", "Canceled");
            }

Step 11:
                     Now Run the Program.
Feel free to contact me at any time for any question regarding c Sharp.


    

No comments:

Post a Comment