C# - Custom control with panel on it, how do I make the IDE add items to the panel?
I have a custom control which contains a panel, of which I want to be able to drop controls on in the VS IDE and have those controls actually be a child of the panel (which is a child of my custom cont开发者_运维技巧rol) and not have them added to the form my custom control is on.
Basically what happens when you drop controls on a panel not contained in a custom control.
I've tried to google it, but can't seem to come up with any good results, any help would be appreciated :)
Assuming that you're talking about WinForms I think you'll get what you want if you change your custom control to inherit from ContainerControl rather than UserControl
.
If it's WebForms it might be worth looking at ContainerControlDesigner, but I don't know much about that.
精彩评论