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.
Leave a Reply
You must be logged in to post a comment.
