C# - 奇怪的 ToolStripMenu 行为
我有一个 ToolStripMenu,它有许多子菜单。在任何给定时间,任何子菜单都可能被禁用,具体取决于程序的当前状态。
我对某个特定菜单项有疑问。我禁用了此菜单项,因此鼠标悬停时不会显示子菜单。如果我只是将鼠标悬停在该项目上,它就会按预期工作,子菜单不会出现。但是,如果我将鼠标悬停在任何其他启用的菜单项上并显示其子菜单,然后立即将鼠标悬停在禁用菜单项上,禁用的子菜单将出现,即使该项目仍处于禁用状态。正如您所期望的,菜单项呈灰色。
菜单项从未在代码中的任何位置显式启用。有人对此有什么想法吗?
I have a ToolStripMenu that has a number of sub menus. At any given time ay of the sub menus may be disabled, depending upon the current state of the program.
I have an issue with a particular menu item. I have this menu item disabled, so that the sub-menu does not show on mousehover. It works as expected if I simply hover my mouse over the item, the sub-menu does not appear. If, however, I hover my mouse over any of the other enabled menu items and have their sub menu appear, then immediately hover the mouse over the disable menu item, the disabled sub-menu will appear, even though this item is still disabled. The menu-item is greyed out as you would expect.
The menu item is never explicitly enabled anywhere within the code. Does anybody have any ideas on this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论