[英]How to play songs in the media element when i selected from listbox control in wpf?
我在列表框控件中有7首歌曲。如果我從列表框中選擇了那些應該在媒體元素中播放的歌曲?
請幫助我..在此先感謝。
您可以使用Listbox
SelectionChanged
事件來更改MediaElement
source
屬性,例如
private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
MediaElement1.Source = new Uri(FilePath);
}
您將在wpf中的MediaElement中獲得有關此信息的更多信息。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.