Solitude,
You need to create a designer for this control and attach it to the control
using the DesignerAttribute.
Make the designer to derive from ParentControlDesigner or
ScrollableControlDesigner (if your control supports scroll bars). In the
designer you can override CanParent virtutal method and check whether the
control can parent the type of the control that is about to be dropped. I
believe this is what you wanted.

Signature
HTH
Stoitcho Goutsev (100)
> Hi,
>
[quoted text clipped - 5 lines]
> help would be great. Thanks,
> Matt
Solitude - 16 Jul 2006 21:08 GMT
Thanks,
that worked great, except that works for Drag and Drop.
But they can select the control in the toolbox without dragging it and click
on my control, this does not fire off the OnDragDrop or the CanParent events.
So how I can I prevent them from adding a control to my control using this
DesignerAttribute method. Thanks,
Solitude
> Solitude,
>
[quoted text clipped - 16 lines]
> > help would be great. Thanks,
> > Matt
Hi Solitude,
A design-time group would be a more appropriate place to ask your question,
but I do have some advice. Derive your control from Panel and you'll get
container designer support for free. To peek at controls that are added to
your control in the designer you can override the ControlAdded method. In
ControlAdded throw an Exception if a Control's Type is not valid as a child
of your Control.
HTH
> Hi,
>
[quoted text clipped - 5 lines]
> help would be great. Thanks,
> Matt