如何使用OpendDialog将歌曲放置在ListBox上 [英] How can I use OpendDialog to place a song on a ListBox

查看:87
本文介绍了如何使用OpendDialog将歌曲放置在ListBox上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好...你们中的每个人都可以帮忙,因为我启动了一个支持音频和媒体格式的应用程序,但是我不知道如何使用OpendDialog将歌曲放置在ListBox上...
最美好的祝愿

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

推荐答案

嗨!

要将歌曲的名称放在列表框中,我建议使用从OpenFileDialog中分离FileName并将其拆分,以便仅提取文件名,例如:

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)




这应该可行,如果您要做的就是添加歌曲的名称到列表框,如果我误解了您的问题,请原谅我.

希望这对您有所帮助!

MrWolfy :-D




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


选中此链接. [
Check this link.[^]

Hope this will help you.



Pershendetje


这篇关于如何使用OpendDialog将歌曲放置在ListBox上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆