钩在TextBox离开事件中 [英] Hooking in TextBox Leave Event

查看:64
本文介绍了钩在TextBox离开事件中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我一直在一个迁移应用程序中工作,我发现了一个奇怪的问题,两次离开事件触发导致验证两次触发,因此我想拦截要由应用程序处理的事件.

I have been working in an Migration Application where  i find out some weird problem , Leave Event Fires twice causing validation to fire twice , hence i want to intercept the events to be processed by application .

因此,在挂接委托时需要帮助,以便我可以获取要处理的事件的列表.

Hence require help in hooking the delegates so that i can get a list of the events that are to be processed .

如果有人可以通过提供一些信息或代码来帮助我,因为将如何在文本框内离开事件实现钩子,将不胜感激.

If anybody can help me out by giving some info or code as how to implement hooking in a textbox leave event would be grateful .

预先感谢

推荐答案

大家好,

我们有一个已从Vb6迁移到Vb.Net的应用程序,我们创建了Masked Edit Custom Control(屏蔽编辑自定义控件),并对Masked Edit控件具有其他行为.控制期间 控件的离开"事件.

We have a application that has been migrated from Vb6 to Vb.Net , we have created Masked Edit Custom Control with additional behaviors to the Masked Edit control . Also we have some validaton that validates the text entered into the custom control during the Leave event of the control .

当我们从控件中跳出时,该事件正常运行,问题是我们使用了一个底部的窗体,该窗体具有用于导航至其他窗体的按钮,因此,当我们单击下一个按钮时,验证事件将首次触发两次,其他时候是 工作完美.

The Event works properly when we tab out of the control , the problem is we use a bottom form which has buttons to navigate to other forms , hence when we click either the next button the validation event fires twice for the first time , other times it is working perfect .

一直在寻找控件的这种奇怪行为,但找不到任何合适的解决方案.

Has been searching about this odd behaviour of the control but couldnt find any proper solution for this .

希望我在这里得到一些解决方案.

Hope i get some solution here .

先谢谢了.

 


这篇关于钩在TextBox离开事件中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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