MDI父菜单和子菜单 [英] MDI Parent Menu and Child Menu

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

问题描述

我正在Winforms Development上使用VB.Net开发MDI应用程序.

I am using VB.Net on Winforms Development developing an MDI application.

在我的父母表格中,我有一个菜单栏.在我的子窗体中,我还为每个窗体附加了一个菜单栏,该菜单栏在访问时会调用不同的命令集.那么,在MDI表单中,当前处于活动状态的子表单是否可能成为将在父表单中显示的菜单?

In my Parent form, I have a menu strip. In my child forms, I also have a menu strip attached to each form, which invokes a different set of command when accessed. Is it possible then that in an MDI form, the child form which is currently active be the menu that would display in the parent form?

推荐答案

很简单.只需将MenuStrip添加到父项,但将其保留为空.内置的菜单合并支持可确保活动子菜单显示在空白父栏中.

It's easy. Just add a MenuStrip to the parent but leave it empty. The built-in support for menu merging ensures that the active child's menu appears in the empty parent strip.

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

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