Bee Eee Blog

Making a UserControl a design time container for controls.

by brian on Jan.04, 2008, under Uncategorized

It turns out that a user control can fairly easily become a container control during design time. In other words being able to put other controls within your user control is fairly straight forward.

The steps are as follows.

add the following to your usings section:

using System.ComponentModel.Design;

and then add the following attribute just above your declared class.

[Designer("System.Windows.Forms.Design.ParentControlDesigner, System.Design", typeof(IDesigner))]

public class UserControl1 : System.Windows.Forms.UserControl

{
...
}

Then recompile the project and there it is.

No comments for this entry yet...

Leave a Reply

You must be logged in to post a comment.

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...