Exemplo n.º 1
0
        private void MusicList_Click(object sender, EventArgs e)
        {
            if (musicList.SelectedItem != null)
            {
                WMPLib.IWMPMedia media;
                media = WMP.newMedia(music.patchs[musicList.SelectedIndex]);

                metroScrollBarMusic.Value   = 1;
                metroScrollBarMusic.Minimum = 1;
                metroScrollBarMusic.Maximum = (int)media.duration;
                metroScrollBarMusic.Update();

                WMP.currentMedia = media;
                WMP.Ctlcontrols.play();
                timer1.Start();
            }
        }
Exemplo n.º 2
0
 private void AddInPlayListWMP(string music)
 {
     WMPLib.IWMPMedia media = WMP.newMedia(music); // создаем новую медиа, и добавляем её в список
     WMP.currentPlaylist.appendItem(media);
 }