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;

posted @ 2013-09-02 23:38  花式炒饭  阅读(526)  评论(0编辑  收藏  举报