TextBox 的 KeyEventArgs事件触发

asp:TextBox  的 KeyEventArgs事件触发

 

C# code

      

  privatevoid txt123_KeyDown(object sender, KeyEventArgs e)

        {

            
if (e.KeyCode == Keys.Enter)

            {

                btn.PerformClick();

            }

        }

 

 

----------------------------

private void text_KeyPress(object sender, KeyPressEventArgs e)

{

if(e.KeyChar==13)
{

...

}

}

 

posted @ 2012-11-29 10:07  上善若水-water  Views(420)  Comments(0)    收藏  举报