c# - 如何在 Windows 窗体 C# 中的 MouseDown 上启动声音播放器
问题描述
当我触发soundPlayer.Play();
按钮的单击事件时,它仅在您取消单击按钮后播放。我试图在 MouseDown 上触发它
private void Button_MouseDown(object sender, EventArgs e)
{
soundPlayer.Play();
}
但这并没有做任何事情。我怎样才能让它工作?
编辑:我想通了,我通过进入属性下的事件并使用 MouseDown 事件来做到这一点
解决方案
推荐阅读
- android - allDocs之间的区别,在关系袋中找到性能
- ios - 使用蓝牙将数据从 carplay 应用程序传输到 iPhone 应用程序
- flutter - 我需要一个不重复的随机数生成器
- node.js - for 循环中的代码不会在行编辑器的 Node JS Dialogflow 中执行
- python - 如何使用正则表达式从字符串中提取文件名
- xamarin.forms - 从 Xamarin.Forms 中 AndroidAssets 的子文件夹中读取(音频)文件
- javascript - 如何在 components.ts 文件中使用 KeyValuePipe?
- java - 为什么休眠查询语言不支持 HQL 中的排序规则?
- umbraco - 无法保存非当前版本 - Umbraco 8
- android - 解锁 HTML 文件