Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi everyone...Can anyone of you help with this task because I started an application that supports audio and media format but I don't know how can I use OpendDialog to place a song on a ListBox...
best wishes

Posted

Hi!

To just put the song's name in the listbox I suggest using the FileName from the OpenFileDialog and splitting it in order to extract the filename only, for example:

Dim OpenSong As New OpenFileDialog<br />OpenSong.ShowDialog()<br /><br />If Not OpenSong.CheckFileExists Then Exit Sub<br />If OpenSong.FileName = "" Then Exit Sub<br /><br />Dim SongSplit As Array = Split(OpenSong.FileName, "\")<br />Dim SongName As String = SongSplit(SongSplit.Length - 1).ToString<br />MyListBox.Items.Add(SongName)



This Should Work, If All you want to do is add the song's name to a listbox, forgive me if I misunderstood your question.

Hope This Helps!

MrWolfy :-D
 
Share this answer
 
Check this link.[^]

Hope this will help you.



Pershendetje

 
Share this answer
 


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900