WinForms 打开弹出用户控件作为 menuitem 菜单下拉菜单?

发布于 2024-07-18 06:34:20 字数 310 浏览 7 评论 0原文

到处寻找,但找不到方法来做到这一点。

我的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

慕烟庭风 2024-07-25 06:34:20

我最近不得不将自己的轨迹栏添加到工具栏,这涉及从 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文