仅将我的C#应用​​程序静音 [英] Mute my C# application sounds only

查看:76
本文介绍了仅将我的C#应用​​程序静音的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的C#应用​​程序中,当我按下文本框中的输入时发出声音。我怎么把这个声音静音。仅在我的应用程序中静音。不在系统中。



我尝试了什么:



我用谷歌搜索但结果不合适

In my C# application sounds coming while I press enter in textboxes. How I mute that sounds. Mute only in my application. Not in system.

What I have tried:

I Googled but came with not suitable result

推荐答案

正如评论中所述,看起来这可能有效, c# - 按Enter键停止'Ding' - 堆栈溢出 [ ^ ]



就个人而言,我建议反对。如果用户在系统级别启用了声音,我认为您的应用不应忽略它们。例如,正如Peter指出的那样,用户可能是盲人或有其他可访问性问题。
As mentioned in comments, Looks like this might work, c# - Stop the 'Ding' when pressing Enter - Stack Overflow[^]

Personally, I would suggest against it. If a user has sounds on at the system level I don't think your app should ignore them. For example, as Peter pointed out, the user could be blind or have other accessibility issues.


这里我也发布了相同的答案。也许这对某人有帮助。



Here also I am posting the same answer. Maybe It would help someone.

private void textBox1_KeyDown(object sender, KeyEventArgs e)
{

//Se apertou o enter
if (e.KeyCode == Keys.Enter)
{
//enter key is down

this.doSomething();//some commands you want to execute.

e.Handled = true;
e.SuppressKeyPress = true;

}

}


这篇关于仅将我的C#应用​​程序静音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆