Merge menu items from MDI child into container's menu

て烟熏妆下的殇ゞ 提交于 2019-12-24 00:46:41

问题


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?


回答1:


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

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

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



来源:https://stackoverflow.com/questions/22991759/merge-menu-items-from-mdi-child-into-containers-menu

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