WinForms MdiContainer Menu

这一生的挚爱 提交于 2019-12-20 07:25:21

问题


All, I have a WinForms MDI control and in it I dock several child windows. When I first did this I managed (somehow) to get rid of the window list (shown above the tabbed forms below)

I am not talking about the double window menu (on the right) I know that this is due to a bug in the WinForms control and that if you add MdiChild elements in the Load event instead of the Constructor, this behaviour resolves itsef (see this post for details).

Here I am talking about the menu strip itself, I don't want it! How do I get rid of it? Any advice is much appreciated...

Note: I am adding MdiChild forms in the following way:

foreach (Form mdiChild in MdiChildForms)
{
    mdiChild.MdiParent = this;
    mdiChild.Show();
}

where MdiChildForms is a List<Form>.


回答1:


Here is the possible solution:

public MainForm() {
    IsMdiContainer = true;
    InitializeComponent();
    this.MainMenuStrip = new MenuStrip(); // create our own menu strip
    this.MainMenuStrip.Visible = false;   
}


来源:https://stackoverflow.com/questions/9568269/winforms-mdicontainer-menu

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!