控件事件不读 [英] Controls Events are not reading

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

问题描述

我刚刚在GroupBox中保留了所有控件。现在我正在尝试使用事件编码,但它使用_1名称创建新事件。



例如旧的txtName_Gotfocus(...)和新的txtName_Gotfocus_1(...)



i已经检查过深深地,发现它已经从控制事件中移除了所有的手柄........


为什么会出现这种情况?我刚刚在GroupBox中剪切并粘贴所有控件以进行分组?



请回复...

解决方案

< blockquote>当您剪切并粘贴具有处理程序事件的控件时,设计人员无法理解您的操作。当你剪切它们时它认为你删除它们 - 所以它认为它应该删除处理程序,因为它们已经消失了。粘贴后没有机制可以将它们添加回来。它就是这样。


I have just kept all controls in GroupBox. Now I am trying to use it events coding but it makes new event with _1 name.

e.g old txtName_Gotfocus(...) and new txtName_Gotfocus_1(...)

i have checked deeply, found that it has removed all Handles ....... from controls events.

why this happended ? i have just cut and paste all controls in GroupBox for grouping only ?

Please reply...

解决方案

When you cut and paste controls that have handler event, the designer does not understand what your doing. When you cut them it thinks you removed them - so it thinks it should remove the handler since they are gone. There is no mechanism to add them back after they are pasted back. It is what it is.


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

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