Design time nested Panels VS dynamic nested Panels?

Winston

Junior Contributor
Joined
Jan 25, 2003
Messages
266
Location
Sydney, Australia
this might sound weird but

say you add a Panel within a panel, and you can drag controls into the inner Panel.

This works great, however, i'm making a custom control where the main entire thing is inherited from Panel and there's lots of painting, then in the constructor of this inherited panel i create another panel and position it etc, and do this.Controls.Add(panel);

So once compiled i add it to a project, but when i try to drag a new control say a button into this container the button will only go into the primary panel but not the inner panel i dynamically created and added in the constructor, what is the difference from dynamically doing so and allowing people to drag controls into the inner panel as opposeed to doing it during design time?

Hope someone can help, thanks!
 
I think (somebody may well correct me) but the differnce is this. When you are adding a panel to another panel using the designer it logical just changes the parent of the control your adding to the panel control you add it to but all the objects are still in the same scope. But when you have a panel added to a user control its properties are wrapped and hence cannot be fully accessed by the designer as they are in a different scope.
 
Back
Top