重新连接事件和控件 [英] Reconnecting Events and Controls

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

问题描述

大家好!



我正在使用应用程序中的不同标签。我想将一个子选项卡移动到另一个选项卡控件。

当我将子选项卡复制并粘贴到另一个选项卡控件时,子选项卡控件的所有事件(按钮)等等。不能在命运选项卡控件中工作。



当我看到控件的属性时,事件已经消失。

你能帮我吗?





问候¡div class =h2_lin>解决方案

不,这是设计 - 我可以理解为什么。



如果您复制并粘贴任何控件(不只是TabPage或TabControls之间),只有属性被复制:不复制任何事件分配。这是(我认为)以防止混淆!如果它复制了所有事件分配的图像 - 当你复制一个按钮时,它们在点击时都会做同样的事情!



AFAIK,没有工作回合复制事件也是如此,你必须在设计师中手动应用它们。



如果你拖放控件,它将保留任何事件分配。


如果您使用文档大纲或Ctrl + WU



谢谢!

Hi everyone!!

I'm working with different tabs in an application. I want to move one "child Tab" to another Tab Control.
When i copy and paste the "child tab" to the other Tab Control, all the events of the "child Tab" controls(buttons, etc.) don't work in the destiny Tab Control.

When i see the propperties of the controls, the events have disappeared.
Can you help me please?


Regards¡

解决方案

No, this is by design - and I can understand why.

If you copy and paste any control (not just a TabPage or between TabControls), only the properties are copied: no event assignments are copied. This is (I think) to prevent confusion! Image if it did copy all event assignments - when you copied a button, they would both do the same thing when clicked!

AFAIK, there is no work round to copy the events as well, you will have to manually apply them in the designer.

If you drag and drop the control instead, it will retain any event assignments.


You can move the controls over the form if you use the "Document Outline" or Ctrl+W U

Thanks!


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

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