Wednesday, July 17, 2013

Simple Media Player in C# Window Application

Simple Media Player in c# window application Open Visual studio just follow to simple step
Visual c# - Windows From Application - OK
Now we saw form1 page and start to drag some element from toolbox (Ctr+w,t)
take 1 openFileDialog, 1 window media player and buton1 (Browser),button2 (Close)











 Now double click on Browser Button and copy this 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 mediaplayer { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { { openFileDialog1.Filter = "(mp3,wav,mp4,mov,wmv,mpg)|*.mp3;*.wav;*.mp4;*.mov; *.wmv;*.mpg|all files|*.*"; if (openFileDialog1.ShowDialog() == DialogResult.OK) axWindowsMediaPlayer1.URL = openFileDialog1.FileName; } } } also double click on Exit button private void button2_Click(object sender, EventArgs e) { MessageBox.Show("Media Player closing....."); Application.Exit(); }
now click F5 for run............. Your Suggestion in Comment Box

No comments:

Post a Comment

My First Investment

My First Investment This is a story of my first investment experience. I started investment 6 month before. As everyone has a desired ...