合并从MDI子菜单项到容器的菜单 [英] Merge menu items from MDI child into container's menu

查看:234
本文介绍了合并从MDI子菜单项到容器的菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经完全遵循<一所述的步骤href="http://stackoverflow.com/questions/3511145/merge-menu-strip-items-for-mdi-windows/3513116">Merge对于MDI窗口菜单条项创建一个测试应用程序的MDI容器和MDI子与文件菜单。我已经在Visual Studio 2013试过这种对每一个.NET框架2.0至4.5,并且还试图在Visual Studio 2012的结果是一样的。该菜单不合并。我得到的是这样的:

I have exactly followed the steps described in Merge menu strip items for MDI windows to create a test application with an MDI container and an MDI child with a File menu. I have tried this in Visual Studio 2013 for every .NET framework from 2.0 to 4.5, and also tried in Visual Studio 2012. The result is the same. The menus do not merge. All I get is this:

这两个文件的菜单都应该是一个,或至少两个在菜单栏。这是怎么回事?一个是应该如何让这些菜单自动合并?

The two file menus are supposed to be one, or at least both be in the menu bar. What's going on? How is one supposed to get these menus to automatically merge?

推荐答案

在你的窗体2的构造,设置MenuStrip控件的可见性设置为false:

In your Form2 constructor, set the visibility of the MenuStrip control to false:

public Form2() {
  InitializeComponent();
  menuStrip1.Visible = false;
}

中的C菜单应为主要形式的文件菜单上可见。

The "C" menu should be visible on the main form's File menu.

这篇关于合并从MDI子菜单项到容器的菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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