控制剪切/粘贴 [英] controls cut/paste

查看:75
本文介绍了控制剪切/粘贴的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果Tab控件上有很多控件,并且所有控件都为它们编写了代码。


现在,如果你想将这些控件从Tab Control移动到其他部分表单然后它们的代码将与它们断开关联。


如果您想再次将代码与控件关联,可以通过单击控件''手动完成事件将会完成。


但这样,每个控件都必须逐个完成...当你从TabControl剪切/粘贴控件时,是否有任何一个控件其他地方,代码仍然与他们相关联?

If you have many controls on a Tab Control and all of them have code written for them.

Now if you want to move these controls from Tab Control to some other part of the form then the code for them will be dis-associated from them.

If you want to associate the code again with the control, it has be done manually by clicking on control''s event and it will be done.

but this way, each control has to be done one by one... is there any one when you cut/paste controls from TabControl to some other place, the code remain associated with them ?

推荐答案

对不起,不!您可以选择多个控件并对它们执行一些操作,例如更改字体/颜色/属性,但您不能多选并更改涉及进入代码编辑器的属性,这是您需要的将它们与代码重新关联起来。


Linq
Sorry, no! You can select multiple controls and do a some of things to them, such a change the font/color/attributes, but you can''t multi-select and change properties that involve going into the code editor, which is what yu need to do to re-associate them with their code.

Linq



如果你有很多Tab控件上的控件,所有这些控件都有为它们编写的代码。


现在,如果你想将这些控件从Tab Control移动到表单的其他部分,那么它们的代码它们将与它们脱节。


如果你想再次将代码与控件相关联,可以通过点击控件的事件手动完成,它将完成。


但这样,每个控件都必须逐个完成...当你从TabControl剪切/粘贴控件到其他地方时,是否存在任何一个控件,代码保持关联状态跟他们 ?
If you have many controls on a Tab Control and all of them have code written for them.

Now if you want to move these controls from Tab Control to some other part of the form then the code for them will be dis-associated from them.

If you want to associate the code again with the control, it has be done manually by clicking on control''s event and it will be done.

but this way, each control has to be done one by one... is there any one when you cut/paste controls from TabControl to some other place, the code remain associated with them ?

尝试修改表单上所有控件的OnClick()事件,如下所示:

Try modifying the OnClick() Event of all Controls on the Form as in:

展开 | 选择 | Wrap | 行号


优秀的黑客,ADezii!如果我把它贴在任何地方,我会把它放在我的参考文献中并给你信任!


Linq ; 0)>
Excellent hack, ADezii! I''ll put it in my references and give you credit if I post it anywhere!

Linq ;0)>


这篇关于控制剪切/粘贴的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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