I have a user control called "View" with a nested panel that correctly
accepts components at design time. I have derived another user control called
"FunctionView" from View where I want to add more components at design time.
However, the derived user control does not accept components when they are
dragged onto it at design time. The derived user control does not seem to
inherit the designer of the base class or its own designer is preventing
components from being added. Can someone help me with this issue? Do I need
to specify a designer again for the derived user control? I tried various
ways of doing this without success.
[Designer(typeof(ViewDesigner))]
public partial class View : UserControl
{
public View()
{
InitializeComponent();
}
[DesignerSerializationVisibility(DesignerSerializationVisibility.
Content)]
public Panel ViewPanel
{
get
{
return viewPanel;
}
set
{
viewPanel = value;
}
}
}
public class ViewDesigner : ControlDesigner
{
public override void Initialize(IComponent comp)
{
base.Initialize(comp);
View view = (View)comp;
EnableDesignMode(view.ViewPanel, "ViewPanel");
}
}
public partial class FunctionView: View
{
}
PureCode - 24 Sep 2006 02:12 GMT
Instead of 'ControlDesigner' use 'ParentControlDesigner' with your
ViewDesigner class.
Pure.
>I have a user control called "View" with a nested panel that correctly
> accepts components at design time. I have derived another user control
[quoted text clipped - 50 lines]
> {
> }