C# 创建容器控件的简单方法

只需将 System.ComponentModel.DesignerAttribute 属性应用到该控件即可:

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

   public partial class UserControl1 : UserControl
   {
        public UserControl1()
        {
            InitializeComponent();
        }
   }

//因为要实现IDesigner接口引用using System.ComponentModel.Design;

原文地址:https://www.cnblogs.com/bjchaofan/p/3297865.html