问题
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