Question Only Show File Name But...?

Jamie2993

Member
Joined
May 13, 2009
Messages
11
Programming Experience
1-3
Hi All,

Im trying to create a playlist for my program (which ive done),
ive also got it to rename the items (just to show songname.mp3),

my problem is:

when the person Double-Clicks on an item in the listbox it wont play it because it plays the value of the selected item.

Any idea's On how to rename it to only the songname but still be able to play it?

My rename code:
VB.NET:
        importdiag.ShowDialog()
        For Each item In importdiag.FileNames
            playlist.Items.Add(IO.Path.GetFileName(item))
        Next
 
you the code to play is just:
VB.NET:
 AxWindowsMediaPlayer1.URL = playlist.SelectedItem
but i dont see how that has anything to do with it...



Any Idea's how to rename but still be able to play from the double click of that item
 
VB.NET:
Dim files As New List(Of IO.FileInfo)(importdiag.FileNames.Count)

For Each fileName In importdiag.FileNames
    files.Add(New IO.FileInfo(fileName))
Next

playlist.DisplayMember = "Name"
playlist.ValueMember = "FullName"
playlist.DataSource = files
When the user selects a file name in the ListBox you get its full path from the SelectedValue property.
 
Back
Top