WPF中带有括号或括号的工具提示的怪异渲染行为 [英] Weird rendering behavior in WPF for ToolTips with brackets or parentheses
问题描述
我有一个按钮,其工具提示定义如下:
<按钮宽度="25" ToolTip =删除所选名称(Ctrl + F12).">-</按钮>
当我在运行时将鼠标悬停在按钮上时,工具提示显示为
(.删除所选名称(Ctrl + F12
我也尝试过将工具提示定义为
<按钮宽度="25">< Button.ToolTip>删除所选名称(Ctrl + F12).--</按钮>
我也尝试使用方括号代替括号.
在所有情况下,最后一个结束符之后的文本)或]都将被截断并附加在字符串的开头,并以一个开头作为前缀(或[.干dry了,我是不是在某个地方缺少明显的东西,还是我最终会失去抓地力?
这使用的是.Net框架的4.0版本.
我刚刚遇到了同样的问题,我做了一些变通方法,就是将一个空格放在一个点后,就像魅力.
I have a button with a tool tip defined as follows:
<Button Width="25" ToolTip="Delete selected name (Ctrl + F12).">-</Button>
When I hover over the button at run time the tooltip displays as
(.Delete selected name (Ctrl + F12
I have also tried defining the tooltip as
<Button Width="25">
<Button.ToolTip>Delete selected name (Ctrl + F12).</Button.ToolTip>
-
</Button>
I have also tried using brackets instead of parentheses.
In all cases text after the final closing ) or ] is being cut off and perpended to the front of the string, prefixed by an opening ( or [. I have googled for any hint of special escaping needed for tool tips and come up dry. I am I missing the obvious somewhere or am I going finally loosing my grip? :-|
This is using the 4.0 version of the .Net framework.
I've just encountered the same problem, I've done a bit of a workaround which simply was to put a space after a dot and it works like a charm.
这篇关于WPF中带有括号或括号的工具提示的怪异渲染行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!