开发者

How to play songs in the media element when i selected from listbox control in wpf?

开发者 https://www.devze.com 2023-03-29 23:28 出处:网络
i have 7 songs in list box control.if i selected those songs from listbox that songs should be 开发者_如何学JAVAplay in media element?

i have 7 songs in list box control.if i selected those songs from listbox that songs should be 开发者_如何学JAVAplay in media element?

please help me.. thanks in advance.


You can use the Listbox SelectionChanged event for changing theMediaElement source property like

private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
    {
        MediaElement1.Source = new Uri(FilePath);
    }

You will get more informatin about this in MediaElement in wpf

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号