鼠标悬停在按钮WPF上的声音 [英] sound on mouse over button wpf
本文介绍了鼠标悬停在按钮WPF上的声音的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在开发一个应用程序,我想在鼠标经过按钮上方时添加声音,我试图以此方式进行操作,但没有成功:
Hi,
I ''m developping an application and i want to add sound when the mouse passes over a button i tried to do it this way but it didn''t work:
soundPlayer s=new soundPlayer(myfile.wav);
s.play();
推荐答案
private void btnPlay_Enter(object sender, EventArgs e)
{
soundPlayer s=new soundPlayer(myfile.wav);
s.play();
}
这篇关于鼠标悬停在按钮WPF上的声音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文