Cannot parent controls to a custom(derived) control

C

CroDude

Hi all!
I've made a custom group-box control derived from a GroupBox. Additionally
I've made a ControlDesigner derived class associated with my group box to
remove some unneeded properties.
But after utilizing this ControlDesigner, I can't parent any control to my
group box in a design view(When not applying ControlDesigner everything
works fine).
Here's the code:

internal class CGroupBoxDesigner : ControlDesigner
{
public CGroupBoxDesigner()
{
}
protected override void PostFilterProperties(IDictionary Properties)
{
Properties.Remove("BackgroundImage");
Properties.Remove("BackColor");
Properties.Remove("FlatStyle");
}
}

and this is how is this ControlDesigner is applied to a group box:
[Designer(typeof(CGroupBoxDesigner)), Description("Custom group-box
control.")]
public class CGroupBox : System.Windows.Forms.GroupBox
{
.......
}

I know that I'm missing something simple here ... Please help.

Thanx!
D.
 
D

Dave

Try deriving from
System.Windows.Forms.Design.ParentControlDesigner (System.Design assembly)
instead of ControlDesigner.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top