以设计器形式隐藏我的用户控件

时间:2014-09-26 21:05:18

标签: c# winforms controls designer

我如何隐藏设计器表单中的用户控件,以显示在设计器底部,如计时器或openFileDialog ......

我想要做的是自定义menuStrip,包括animation,progressBar,dateTimePicker等。但我不想在设计师中看到它,就像普通的menuStrip一样。

我试图将我的用户控件作为组件,但如果我这样做,我会失去其他人。

一个例子是:

public class ExampleForm : Form
{
    public ExampleForm()
    {
        CustomMenuStrip a = new CustomMenuStrip();
        a.Items.Add(new CustomMenuStripItem()
        {
            ///Stuff
        });
    }
}
public class CustomMenuStrip : UserControl
{
    public List<CustmMenuStripItem> Items;
    public CustomMenuStrip()
    {
        //Do Stuff
    }
}

public class CustomMenuStripItem : UserControl
{
    public CustomMenuStripItem()
    {
        //Do Stuff
    }

}

有什么想法吗?

提前谢谢。 安德烈

0 个答案:

没有答案