不触发vb.net中的文本框更改事件 [英] Not fire the textbox change event in vb.net

查看:354
本文介绍了不触发vb.net中的文本框更改事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在winform应用程序(VB.Net2003)中有多个文本框,并进行了一些计算,例如1 * 10 = 10.当我在文本框中输入数字值的速度非常快时(即12,16任意),但是我只得到值1的第一位(正确的输出是20,但我只有10).值2不能计算因此,如何纠正此问题.

要使用Textchanged事件....

预先感谢.

i have multiple textbox in winform application(VB.Net2003) with some calculation like 1 * 10 =10. when i enter the numberic values in text box as very fast (ie 12,16 any), But i getting only first digit of value 1 (correct output is 20 but i''m getting only 10). The value 2 is not calculate So, how to rectify this problem.

Textchanged event to be used....

Thanks in advance.

推荐答案


原因是在控件中的每次更改后都会触发Textchanged事件.

干杯
Hi,
The reason is that Textchanged event will be fired after every change in the control.

Cheers



代替TextChange事件,请尝试LostFocus事件.因为此事件将在光标或控件离开文本框后触发,所以您不会丢失任何数字.
检查此链接

http://msdn.microsoft.com/en-us/library/system.windows.forms.control.lostfocus.aspx [ ^ ]

希望它能起作用.
Hi,
Instead of TextChange Event, Try LostFocus Event. because this event will fire after the cursor or control came out of the textbox, so that you may not lose any digits.
check this link

http://msdn.microsoft.com/en-us/library/system.windows.forms.control.lostfocus.aspx[^]

hope it works.


这篇关于不触发vb.net中的文本框更改事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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