C # Multimedia Player

Source: Internet
Author: User

   Stop playing public void Stopfile () {axWindowsMediaPlayer1.Ctlcontrols.stop ();        }//Pause file public void Pausefile () {axWindowsMediaPlayer1.Ctlcontrols.pause ();        }//Play file public void Starfile () {axWindowsMediaPlayer1.Ctlcontrols.play ();            }//List empty public void Clearfile () {listBox1.Items.Clear ();        AxWindowsMediaPlayer1.Ctlcontrols.stop (); } private void Full screen Toolstripmenuitem_click (object sender, EventArgs e) {if (axWindowsMediaPlayer1. Playstate = = WMPLib.WMPPlayState.wmppsPlaying) {Axwindowsmediaplayer1.fullscreen =!axwindowsme            Diaplayer1.fullscreen;        }} private String file = "";        list<string> list = new list<string> ();   Delete a single file public void Delfile () {for (int i = 0; i < ListBox1.Items.Count; i++) {             if (ListBox1.SelectedItems.Contains (Listbox1.items[i])) {ListBox1.Items.Re                    Move (Listbox1.items[i]);                AxWindowsMediaPlayer1.Ctlcontrols.stop ();                      }}} private void Open Toolstripmenuitem_click (object sender, EventArgs e) {            DialogResult dr = Openfiledialog1.showdialog ();            Openfiledialog1.multiselect = true;                    Switch (DR) {case DialogResult.OK:file = openfiledialog1.filename; List.                    ADD (file);                    Axwindowsmediaplayer1.url = Openfiledialog1.filename; LISTBOX1.ITEMS.ADD (openFileDialog1.FileName.Substring (file.                    LastIndexOf ("\ \") +1));                Break            Case DialogResult.No:break;        }} private void Button5_click (object sender, EventArgs e) {starfile (); } privatevoid Button6_click (object sender, EventArgs e) {pausefile ();        } private void Button7_click (object sender, EventArgs e) {stopfile (); }//previous private void Button3_Click (object sender, EventArgs e) {for (int i = 0; I < li StBox1.Items.Count;                    i++) {if (ListBox1.SelectedItems.Contains (Listbox1.items[i])) { If the top if (Listbox1.selectedindex = = 0) {MessageBox.Show                      ("has reached the top"); }//Otherwise the previous song else {listbox1.setselected (lis                        Tbox1.selectedindex-1, True);                        Axwindowsmediaplayer1.url = List[listbox1.selectedindex];                    Return }}}}//Next private void button4_clicK (object sender, EventArgs e) {for (int i = 0; i < ListBox1.Items.Count; i++) {                    if (ListBox1.SelectedItems.Contains (Listbox1.items[i])) {//if the top if (Listbox1.selectedindex = = listbox1.items.count-1) {MessageBox.Show ("already                        Reach the tail part ");                    MessageBox.Show (ListBox1.Items.Count.ToString ()); }//Otherwise the next song else {listbox1.setselected (lis                        Tbox1.selectedindex+1, True);                        Let the song switch to the next song Axwindowsmediaplayer1.url = List[listbox1.selectedindex];                    Return        }}}} private void Select all list Toolstripmenuitem_click (object sender, EventArgs e)                   {Listbox1.multicolumn = true; listbox1.setselected (0, true);                Listbox1.setselected (1, true);                        Listbox1.setselected (2, true);        Listbox1.select ();        } private void Delete Toolstripmenuitem_click (object sender, EventArgs e) {delfile ();        private void plays Toolstripmenuitem_click (object sender, EventArgs e) {starfile ();        } private void Stop Toolstripmenuitem_click (object sender, EventArgs e) {stopfile ();        } private void pauses Toolstripmenuitem_click (object sender, EventArgs e) {pausefile (); } private void Fast rewind Toolstripmenuitem_click (object sender, EventArgs e) {AXWINDOWSMEDIAPLAYER1.CTLC        Ontrols.fastreverse (); } private void Fast forward Toolstripmenuitem_click (object sender, EventArgs e) {AXWINDOWSMEDIAPLAYER1.CTLC        Ontrols.fastforward ();        } private void Empty Toolstripmenuitem_click (object sender, EventArgs e){delfile (); }

C # Multimedia Player

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.