c# code for windows media player in .net



This is A C# Practice code:
        using System;
        using System.Collections.Generic;
        using System.ComponentModel;
        using System.Data;
        using System.Drawing;
        using System.Linq;
        using System.Text;
        using System.Windows.Forms;

        namespace dataentry
        {
            public partial class Form2 : Form
            {
                string name;
                string filepaths;


                public Form2()
                {
                    InitializeComponent();
                }

                private void button10_Click(object sender, EventArgs e)
                {
                    int NUM = dataGridView1.Rows.Add();
                    label1.Text = NUM.ToString();
                    MessageBox.Show(NUM.ToString());
                }

                private void button12_Click(object sender, EventArgs e)
                {
                    this.Hide();
                    //Form1 F1 = new Form1();
                    //F1.Show();
                }

                private void Form2_Load(object sender, EventArgs e)
                {

                }

                private void button1_Click(object sender, EventArgs e)
                {
                    OpenFileDialog media = new OpenFileDialog();
                    if (media.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                    {
                        textBox1.Text = media.FileName;
                        MediaPlayer1.URL = textBox1.Text;
                    }
                }

                private void button2_Click(object sender, EventArgs e)
                {
                    MediaPlayer1.Ctlcontrols.play();
                }

                private void button3_Click(object sender, EventArgs e)
                {
                    MediaPlayer1.Ctlcontrols.pause();
                }

                private void button4_Click(object sender, EventArgs e)
                {
                    MediaPlayer1.Ctlcontrols.stop();
                }

             
              

            
            }
        }

Video For Result:



Share on Google Plus

About Unknown

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Facebook Comment