I've created a custom control. And now I've done something that prevents
me from using the designer to layout controls on my custom control. I
tried deleting the .resx file, thinking the VS would just regenerate
it, but did not.

Here's how I got the problem:

I created a new user control. I called it BaseControl.

I created another new user control. I called it DerivedControl.
After VS generated the .cs file, I changed the base class to
BaseControl.

EG:
public class BaseControl : System.Windows.Forms.Control
public class DerivedControl : BaseControl

Now I am unable to add controls to DerivedControl using the designer.
I have to manually create the code in .cs file. This gets really hard
to lay things out.

So, what I can do so that I can use the designer?

Thnx
Matt

Re: Forms question (.) by Jose

Jose
Wed Jun 23 08:09:56 CDT 2004

To be able to layout controls in your DerivedControl your BaseControl needs
to inherit from System.Windows.Forms.ContainerControl. Also, make sure that
you specify your Designer class for your DerivedControl which, like this:

[Designer(typeof(DerivedControlDesignerClassHere))]
[DesignTimeVisible(true), ToolboxItem(true)]
public class DerivedControl : BaseControl
{
}

--
Regards,

Jose Luis Manners, MCP

"raffelm" <matt.raffel@mindspring.com> wrote in message
news:bad7a602.0406221125.4ca22fab@posting.google.com...
> I've created a custom control. And now I've done something that prevents
> me from using the designer to layout controls on my custom control. I
> tried deleting the .resx file, thinking the VS would just regenerate
> it, but did not.
>
> Here's how I got the problem:
>
> I created a new user control. I called it BaseControl.
>
> I created another new user control. I called it DerivedControl.
> After VS generated the .cs file, I changed the base class to
> BaseControl.
>
> EG:
> public class BaseControl : System.Windows.Forms.Control
> public class DerivedControl : BaseControl
>
> Now I am unable to add controls to DerivedControl using the designer.
> I have to manually create the code in .cs file. This gets really hard
> to lay things out.
>
> So, what I can do so that I can use the designer?
>
> Thnx
> Matt