WinForms 打开弹出用户控件作为 menuitem 菜单下拉菜单?
到处寻找,但找不到方法来做到这一点。
我的 winforms 程序顶部有一个菜单栏。 现在它只是弹出一个正常的菜单项菜单。 我想禁用该菜单并弹出一个漂亮的用户控件,它看起来像该菜单项的下拉菜单,但包含更多自定义功能。 一个很好的例子是 OpenSuse 中的 gnome 菜单栏或 windows vista 中的开始菜单。
有人可以给我指点教程或帮助我找到一种方法来做到这一点吗?
现在我知道,只要菜单项没有子项,菜单就不会出现,这就是我想要做的,但我想在单击该菜单项时用我自己的用户控件模拟该菜单。
谢谢!!!
Been searching everywhere and can't find a way to do this.
I have a menubar across the top of my winforms program. Now it just pops up a normal menuitem menu. I would like to disable that menu and popup a nice looking usercontrol that looks like its the dropdown for that menu item but includes much more customization. A good example would be the gnome menu bar in OpenSuse or the Start Menu in windows vista.
Can anybody point me to a tutorial or help me out in finding a way to do this?
Right now I know that as long as the menuitem has no subitems a menu won't appear, which is what I want to do, but I would like to simulate that menu with my own usercontrol when that menuitem is clicked.
Thanks!!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我最近不得不将自己的轨迹栏添加到工具栏,这涉及从 ToolStripControlHost。 我想您需要执行类似于 MenuStrip 的操作 是 ToolStrip。
这是使用 ToolStripControlHost 的 MSDN 教程,这里是CodeProject 文章,介绍如何将自定义控件添加到 ToolStripDropDownButton。
I had to add my own trackbar to the toolbar recently which involves deriving from ToolStripControlHost. I imagine that you will need to do something similar as MenuStrip is a derivation of ToolStrip.
This is an MSDN tutorial for using ToolStripControlHost and here is a CodeProject article about adding a custom control to a ToolStripDropDownButton.