将Panel Control(例如A)分配给另一个Panel Control(可以是B)。 [英] Assigning a Panel Control (say A) to another Panel Control (may be B).

查看:77
本文介绍了将Panel Control(例如A)分配给另一个Panel Control(可以是B)。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将Panel Control及其所有子控件分配给另一个控件?

让我的表单包含两个面板,例如PanelA和PanelB。



我的表单中的PanelA包含一些控件,但PanelB默认为空面板。



在一段时间内,当按一下按钮时,我只需要将所有控件从PanelA填充到PanelB,(PanelA必须始终包含其控件,重复项或使用的新实例控件需要放在PanelB中)所以现在PanelA和PanelB包含类似控件。

How to Assign a Panel Control with all its child Controls to Another Control?
Let my form contains two Panels say PanelA and PanelB.

PanelA in my form contains some Controls, but PanelB is empty panel by Default.

During time, When a Button Click, I just need to Fill All Controls From PanelA to PanelB, (PanelA must always contains its controls, Duplicates or New Instances of used controls need to place in PanelB) So Now PanelA and PanelB contains Similar Controls.

推荐答案

使用您使用您所说的控件填充的UserControl。当你需要复制它时,就像初始化1个对象UserControl并将其放在另一个面板中一样简单。
Use a UserControl that you populate with the control which you speak of. When you need to duplicate it, it is as simple as initializing 1 object the UserControl and placing it in the other panel.


这篇关于将Panel Control(例如A)分配给另一个Panel Control(可以是B)。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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