将代码中的子菜单项添加到C#中的MenuStrip吗? [英] Add a child menu items in code to MenuStrip in C#?

查看:85
本文介绍了将代码中的子菜单项添加到C#中的MenuStrip吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在窗体中有一个MenuStrip,其中有许多菜单项:
-a
--b
--c
--d

我想编码为:
-a
--b
--c
--d
--- e
--- f

这个怎么做?谢谢.

I have a MenuStrip in Form, in there I had many Menu items:
-a
--b
--c
--d

I want to code to have:
-a
--b
--c
--d
---e
---f

How to do this? Thanks.

推荐答案

最简单的方法是在设计器中创建一个简单的示例. 然后查看myform.Designer.cs文件,您将看到VS是如何做到的.您可以在代码中执行完全相同的操作!
The easiest way to do this is to create a simple example in the designer.
Then look in your myform.Designer.cs file, and you will see how VS does it. You can do the exact same thing in your code!


这将对您有所帮助

http://blogs.circlesource.com/2009/01/20/dynamic-menu-creation / [ ^ ]

动态菜单栏 [
This will help u

http://blogs.circlesource.com/2009/01/20/dynamic-menu-creation/[^]

Dynamic Menu Strip[^]


这篇关于将代码中的子菜单项添加到C#中的MenuStrip吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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