ContextMenuStrip 在 NotifyIcon 上可用,但在 ContextMenu 上不可用?

发布于 2024-09-05 23:36:59 字数 154 浏览 0 评论 0原文

我正在将 ContextMenu 添加到 WinForm 应用程序,并且希望将其关联到 NotifyIcon。问题是 NotifyIcon 的属性仅包括 ContextMenuStrip,而不包括 ContextMenu。

如何向我的图标添加上下文菜单?

谢谢!

I'm adding a ContextMenu to a WinForm application and I want to associate it to a NotifyIcon. The issue is the NotifyIcon's properties only include ContextMenuStrip and not ContextMenu.

How can I add a ContextMenu to my icon?

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

〃温暖了心ぐ 2024-09-12 23:36:59

看看这里我看到它有ContextMenu 属性。您使用什么版本的.Net?也许您正在查看属性网格?您可能必须在代码中设置该属性。

Looking here I see it has a ContextMenu property. What version of .Net are you using? Perhaps you are looking at the property grid? You might have to set that property in code.

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