典型的就是当你在向TextBox控件输入时按回车键,你将会听到电脑的嗡鸣声.为了避免这个嗡鸣声,可以在回车键的KeyPress事件中处理,设置Handled属性为"true",如下例:

 

 1     void TextBox_KeyPress( object sender, KeyPressEventArgs e )
 2       {
 4           switch (e.KeyChar)
 5             {
 6                       case '\r':
 7                                 e.Handled = true;
 8                                 break;
 9             }
 10      }

 
                    
            
                

相关文章:

  • 2022-01-14
  • 2021-07-04
  • 2022-12-23
  • 2021-08-03
  • 2022-12-23
  • 2021-11-11
  • 2021-10-10
  • 2022-03-06
猜你喜欢
  • 2022-12-23
  • 2021-11-13
  • 2022-12-23
  • 2021-09-14
  • 2022-12-23
  • 2022-12-23
  • 2021-10-30
相关资源
相似解决方案