简体   繁体   English

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

[英]ContextMenuStrip Is Available On NotifyIcon, But Not ContextMenu?

I'm adding a ContextMenu to a WinForm application and I want to associate it to a NotifyIcon. 我要将ContextMenu添加到WinForm应用程序中,并且希望将其关联到NotifyIcon。 The issue is the NotifyIcon's properties only include ContextMenuStrip and not ContextMenu. 问题是,NotifyIcon的属性仅包含ContextMenuStrip,而没有ContextMenu。

How can I add a ContextMenu to my icon? 如何向我的图标添加ContextMenu?

Thanks! 谢谢!

Looking here I see it has a ContextMenu property. 在这里,我看到它具有ContextMenu属性。 What version of .Net are you using? 您正在使用哪个版本的.Net? Perhaps you are looking at the property grid? 也许您正在查看房地产网格? You might have to set that property in code. 您可能必须在代码中设置该属性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM