问题描述
可能重复:结果
Enter “&安培;”的符号到Windows窗体的文本标签?
在与绑定到用户填充的特性标签控件的屏幕,我得到的标签上带下划线的字符(助记符),因为底层的数据包含&符号。
On a screen with label controls bound to user-filled properties, I'm getting underlined characters (mnemonics) on the label because the underlying data contains ampersands.
例如,如果绑定属性包含A和B卡车,则标签显示为AB卡车用B下划线。键盘上的Alt-B将关注该标签。
For example, if the bound property contains "A&B Trucking", then the label shows as "AB Trucking" with the B underlined. Alt-B on the keyboard would focus that label.
你如何从绑定控件发生prevent呢?
How do you prevent this from happening with bound controls?
推荐答案
您可以通过在与号要么加倍prevent这个(安培;&放大器;会正确显示为&安培),或者你可以设置UseMnemonic标签的属性设置为false这可能是你的情况最好的解决方案。
You can prevent this by either doubling up on the ampersands (&& will display correctly as &), or you can set the UseMnemonic property of the label to false which is probably the best solution in your case
这篇关于停止被变成了记忆符号/ Windows窗体加速器结合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!