我想做一个自定义的控件MyPanel:Panel,在它的智能标记面板中添加了一个“添加按钮”的命令项,每次单击它时可以向MyPanel中添加一个Button并且让它停靠到MyPanel的顶部。我的DesingerActionList的派生类是这样写的:public class MyPanelActionList : System.ComponentModel.Design.DesignerActionList
    {
        private MyPanel myPanel;
        private DesignerActionUIService designerActionUISvc = null;        public MyPanelActionList(IComponent component)
            : base(component)
        {
            this.myPanel = component as MyPanel;
            this.designerActionUISvc = GetService(typeof(DesignerActionUIService)) as DesignerActionUIService;
        }        public override DesignerActionItemCollection GetSortedActionItems()
        {
            DesignerActionItemCollection items = new DesignerActionItemCollection();
            items.Add(new DesignerActionHeaderItem("方法:"));
            items.Add(new DesignerActionMethodItem(this, "AddMyButton", "添加菜单按钮", "方法:",true));
            return items;
        }        //这个是响应菜单命令的方法。        
        public void AddMyButton()
        {
            Button btn = new Button();
            btn.Visible = true;
            myPanel.Controls.Add(btn);
            btn.Dock = DockStyle.Top;
        }
    }

现在的问题是,仅仅可以实现在设计时添加按钮,但是这些添加的按钮在设计时无法选中,这样我就不能去设置它们的属性了。而且在运行时,这些添加的按钮也不会显示出来,似乎是设计时产生了这些按钮并没有保存下来。我如何能做到跟TabControl控件那样,添加一个TabPage运行时也是存在的呢?请各位大侠指点迷津,最后只剩30分了,谢谢咯