简体   繁体   English

将MDI子项中的menustrip项目合并到父项菜单中

[英]Merging menustrip items from MDI child into parent's menu

I have a MDI child form which has got some menu options under File tag. 我有一个MDI子窗体,在File标签下有一些菜单选项。 Also I have some menu options under the same File tag in the MDI parent form. 此外,我在MDI父窗体中的相同File标签下有一些菜单选项。 How to merge the options under the File menu so that they appear under a single File menu when the child form is maximized. 如何合并“文件”菜单下的选项,以便在子窗体最大化时它们显示在单个“文件”菜单下。 I tried the steps given in the following stackoverflow questions but I did not get the desired solution. 我尝试了以下stackoverflow问题中给出的步骤,但我没有得到所需的解决方案。

Merge menu strip items for MDI windows 合并MDI窗口的菜单条项

Merge menu items from MDI child into container's menu 将MDI子菜单中的菜单项合并到容器菜单中

Following the steps given in the above questions, I have two File menus appearing in the menu bar. 按照上述问题中给出的步骤,我在菜单栏中显示两个文件菜单。 在此输入图像描述

How to resolve this? 怎么解决这个?

I used this solution: 我用过这个解决方案:

  • Set the MergeAction property of your mdi child File menu to MatchOnly 设置MergeAction您的MDI子的财产File菜单MatchOnly
  • Set the Visible property of the menu strip of your child mdi form to false 将子mdi表单的菜单条的Visible属性设置为false

在此输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM