Click here to Skip to main content
11,934,389 members (68,600 online)
Rate this:
Please Sign up or sign in to vote.
See more: VB VB10.0 VB.NET
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 21-Apr-13 1:41am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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.
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web03 | 2.8.151126.1 | Last Updated 21 Apr 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100