为什么在事件触发的文本框中输入第一个字符? [英] Why on entering the first character in a textbox the event triggers ?

查看:98
本文介绍了为什么在事件触发的文本框中输入第一个字符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在文本框中,我想输入代码65来查找表格中的行。会发生的事情是,在输入6本身的

实例中,事件textbox_textchanged正在变为trigerred并且它在表中读取了属于代码6的
行。我想要输入完整的代码,然后单击输入键或tab键,该事件应该被触发。怎么做?

In a textbox I want to enter code 65 to find a row in a table. What happens is that at the
instance of entering 6 itself the event textbox_textchanged is getting trigerred and it reads that
row in the table which belongs to code 6. I want to enter the full code and at the click of enter key or tab key that event should get trigerred. How to do it?

推荐答案

不要使用TextChanged事件 - 它会在文本框中的文本每次更改时触发。

而是使用Validated事件。
Don't use the TextChanged event - it triggers every single time the text in the textbox changes.
Instead, use the Validated event.


这篇关于为什么在事件触发的文本框中输入第一个字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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