C#如何消除按键提示声音? |
您所在的位置:网站首页 › 按control键有声音 › C#如何消除按键提示声音? |
还是以【小键盘】软件为例,按up键、down键、enter键时,系统自带错误提示音,那么如何关闭这个声音?
方法很简单,只要设置对于key_press事件即可,在key_press事件中添加: if (e.KeyChar == (char)13) e.Handled = true;设置textbox(命名:sr24)的源码如下: private void sr24_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == (char)13) e.Handled = true; }这样就可以消除错误提示音了。
本文由查霆原创,转载需授权。原文地址:http://www.zhating.cn/index.php/post/51.html |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |