开启TextBox的AutoComplete功能后,在TextBox的KeyPress事件里捕获不到加车键了,不知道大家没有遇到过类似的问题,提供个解决方案。

解决方案 »

  1.   

    请教个问题..AutoComplete有什么用.谢谢了..
      

  2.   

    应该是AutoCompleteMode属性,它是用来获取或设置控制自动完成如何作用于 TextBox 的选项的。
      

  3.   

    private: System::Void textBox1_KeyPress(System::Object^  sender, System::Windows::Forms::KeyPressEventArgs^  e) {   if ( e->KeyChar == 13)
       {
          // 对回车键进行处理
       }
    这是我设置了AutoCompleteMode为Suggest后在VC++2005测试的代码..能够接受回车键..
      

  4.   

    我的试了下没问题呀,VS2005的WinFrom中  private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
            {
                if (e.KeyChar== 13)
                {                // 对回车键进行处理 
                    MessageBox.Show("按了回车键");
                }         }
      

  5.   

    上面是设置了TextBox的AutoCompleteMode为SuggestAppend
      

  6.   

    TextBox的AutoCompleteSource属性设一下,就不好使了??