Silverlight中已禁用的ContextMenu项的工具提示(Tooltip on disabled ContextMenu Item in Silverlight)

我需要在一些禁用的ContextMenu项目上显示工具提示。 我尝试使用边框并将工具提示和菜单项放在边框中的解决方法,但我的菜单设计完全混乱,将边距,填充和边框厚度设置为0无济于事。 有任何想法吗 ? 另一种方法? 提前致谢

I need to show a Tooltip on some disabled ContextMenu items. I tried the workaround using borders and putting the Tooltip and menu item in the borders, but my menu design completely messes up, setting Margin, Padding and BorderThickness to 0 doesn't help. Any ideas ? Another approach ? Thanks in advance

最满意答案

好的,我知道了,感谢vinod8812 。 我给我的MenuItem一个带有不同VisualStates的样式,然后我只需要将我的MenuItem的VisualState更改为“Disabled”,工具提示工作正常。

VisualStateManager.GoToState(menutitem, "Disabled", true);

不是一个完美的解决方案,但到目前为止会有效。

Ok, i got it, thanks to vinod8812. I gave my MenuItem a style with different VisualStates, then i just needed to change the VisualState of my MenuItem to "Disabled", the tooltip works fine.

VisualStateManager.GoToState(menutitem, "Disabled", true);

Not a perfect solution, but will work so far.

更多推荐

边框,方法,ContextMenu,Tooltip,电脑培训,计算机培训,IT培训"/> <meta name="des