Click here to Skip to main content
15,895,084 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted

1 solution

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.
 
Share this answer
 
Comments
Ashok19r91d 21-Apr-13 22:31pm    
You are right, but is it possible without using user control?
If not please provide some links to start basis of control custom designing. . .
Idle_Force 21-Apr-13 23:53pm    
What platform are you building on? Winforms, WPF, etc...
Ashok19r91d 23-Apr-13 22:29pm    
Windows Form. . .
Idle_Force 24-Apr-13 0:20am    
While you can set each individual contol, a UserControl makes this so much easier. And when you change it in the designer all your instances change after a rebuild. Just seems simpler to me.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900