Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27189

Windows Media Palyer - Show Current Playlist & Delete Song Once Played

$
0
0
Hi & Good Afternoon,

I've got the following code that populates a Listbox with Songs from my PC.

Code:

    Private Sub frmMain_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load

        Dim allMusic() As String = My.Computer.FileSystem.GetFiles(Environment.GetFolderPath(Environment.SpecialFolder.MyMusic), FileIO.SearchOption.SearchAllSubDirectories, "*.mp3", "*.wma").ToArray

        lstSongs.Items.AddRange(allMusic)

    End Sub

    Private Sub lstSongs_DoubleClick(sender As System.Object, e As System.EventArgs) Handles lstSongs.DoubleClick

        Player.currentPlaylist.appendItem(Player.newMedia(lstSongs.SelectedItem))

    End Sub

    Private Sub cmdPlay_Click(sender As System.Object, e As System.EventArgs) Handles cmdPlay.Click

        Player.controls.play()

    End Sub

To add a song to a playlist you just double click on the required song. You can then play the playlist by pressing the Play button.

What I'd like to do is see the actual playlist in another Listbox, so if you double click on the songs Listbox to add to the playlist the other Listbox will be update accordingly.

Now for the slight twist.... How can remove the song that has just been played from the playlist?

Any thoughts, ideas or pointers will be appreciated.

Thanks & Regards

Viewing all articles
Browse latest Browse all 27189

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>