Click here to Skip to main content
11,802,636 members (70,023 online)
Rate this: bad
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 0: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 at 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 at 21-Apr-13 23:53pm
What platform are you building on? Winforms, WPF, etc...
Ashok19r91d at 23-Apr-13 22:29pm
Windows Form. . .
Idle_Force at 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
0 KrunalRohit 366
1 OriginalGriff 365
2 F-ES Sitecore 295
3 Afzaal Ahmad Zeeshan 230
4 CPallini 230
0 OriginalGriff 2,950
1 Maciej Los 1,910
2 KrunalRohit 1,862
3 CPallini 1,695
4 Richard MacCutchan 1,157

Advertise | Privacy | Mobile
Web01 | 2.8.151002.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