如何防止功能区控件 (winforms) 上的 Infragistics ComboBoxTool 中弹出不需要的工具提示
我在 UltraToolbarsManager 上有一个 ComboBoxTool 实现功能区控件。无论我将 ToolTipText 设置为什么,它总是显示工具提示:
[例如,将鼠标悬停在 gdg 组合显示上[this]
我尝试将所有其他工具提示相关属性(ToolTipTextFormatted、ToolTipTitle)设置为 null,但这没有帮助。
- 如果指定了非零长度的工具提示文本,则按预期显示
- 功能区子控件均以编程方式添加功能
- 区上的其他控件没有此问题
我还尝试在虚拟项目上设置一个非常简单的功能区,并且不会表现出这种奇怪的行为。所以这是其他因素在影响这一点。
I have a ComboBoxTool on an UltraToolbarsManager implementing a ribbon control. No matter what I set the ToolTipText to it always displays a tooltip:
[e.g. mousing over the gdg combo show this]
I have tried setting all the other tooltip related attributes (ToolTipTextFormatted, ToolTipTitle) to null but this doesn't help.
- If a non-zero length tooltip text is specified then this shows as expected
- The ribbon child controls are all added programatically
- The other controls on the ribbon do not have this issue
I have also tried setting-up a very simple ribbon on a dummy project and that does not exhibit this strange behaviour. So it is something else that is effecting this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看起来这可能是一个错误。您或许应该将其提交给 Infragistics。
如果您不希望为整个功能区组显示任何工具提示,可以将 RibbonGroup.Settings.ShowToolTips 值设置为 False。事实上,如果您想在更大范围内关闭工具提示,可以将以下属性之一设置为 False:
每个属性都会打开关闭关联容器内所有工具实例的工具提示。
但是,如果您只想关闭该工具的工具提示,则可以使用从 ComboBoxTool 派生的工具。在派生工具中,您可以覆盖 ShouldDisplayToolTip 并且可以返回 False。
It looks like it may be a bug. You should probably submit it to Infragistics.
If you don't want any tool tips displaying for the entire ribbon group, you can set the RibbonGroup.Settings.ShowToolTips value to False. In fact, if you want to turn off tool tips on a wider scale, you can set one of the following properties to False instead:
Each property will turn off tool tips for all tool instances within the associated container.
But if you only want to turn of tool tips for this one tool, you can use a tool that derives from ComboBoxTool. In your derived tool, you can override ShouldDisplayToolTip and you can return False.
Infragistics 提供了答案:
将您自己的 CreationFilter 添加到 ToolbarsManager
ultraToolbarsManager1.CreationFilter = new MyCreation();
捕获工具创建并用您自己的实现替换工具提示
需要进行一些调整才能将工具提示放在正确的位置并从 TooltipTextResolved 中获取工具提示文本。
Infragistics supplied an answer:
Add your own CreationFilter to the ToolbarsManager
ultraToolbarsManager1.CreationFilter = new MyCreation();
Catch the tool creation and replace the tooltip with your own implementation
Required a bit of tweaking to get the tooltip in the right place and pick-up the tooltip text from TooltipTextResolved.