private void button2_Click(object sender, EventArgs e) { Debug.WriteLine("Index:"); playlist.clear(); listBox1.Items.Clear(); listBox1.ClearSelected(); media.Clear(); button1_Click(null, null); }
private void OpenMusic(object sender, EventArgs e) { playlist.clear(); musicFolder.InitialDirectory = folder; WMPLib.IWMPMedia media; if (musicFolder.ShowDialog() == DialogResult.OK) { foreach (string file in musicFolder.FileNames) { media = mediaPlayer.newMedia(file); playlist.appendItem(media); } } mediaPlayer.currentPlaylist = playlist; mediaPlayer.Ctlcontrols.stop(); }