[英]How to play songs in the media element when i selected from listbox control in wpf?
i have 7 songs in list box control.if i selected those songs from listbox that songs should be play in media element? 我在列表框控件中有7首歌曲。如果我从列表框中选择了那些应该在媒体元素中播放的歌曲?
please help me.. thanks in advance. 请帮助我..在此先感谢。
You can use the Listbox
SelectionChanged
event for changing the MediaElement
source
property like 您可以使用Listbox
SelectionChanged
事件来更改MediaElement
source
属性,例如
private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
MediaElement1.Source = new Uri(FilePath);
}
You will get more informatin about this in MediaElement in wpf 您将在wpf中的MediaElement中获得有关此信息的更多信息。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.