WinForms MdiContainer 菜单 [英] WinForms MdiContainer Menu

查看:30
本文介绍了WinForms MdiContainer 菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所有,我有一个 WinForms MDI 控件,并在其中停靠了几个子窗口.当我第一次这样做时,我设法(不知何故)摆脱了窗口列表(显示在下面的选项卡表单上方)

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)

我不是在谈论双窗口菜单(在右侧)我知道这是由于 WinForms 控件中的一个错误,并且如果您在 Load 事件中而不是在构造函数中添加 MdiChild 元素,此行为将解决它(查看这篇文章了解详情).

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...

注意:我通过以下方式添加 MdiChild 表单:

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

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

其中 MdiChildFormsList

.

推荐答案

以下是可能的解决方案:

Here is the possible solution:

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

这篇关于WinForms MdiContainer 菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆