如何放置& c#标签盒中的符号? [英] how to place a & symbol in c# label box?

查看:99
本文介绍了如何放置& c#标签盒中的符号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在我的标签框中给出一个&时,它显示为_(下划线)。但在这里我不想要下划线我只需要和符号。

这是示例文本显示在我的标签框中:M / S.XXXXXX Hotels&Tourism。

when i give a & in my Label box it display like _(underscore). but here i don''t want underscore i need only & symbol.
this is sample text to show in my label box :"M/S. XXXXXX Hotels & Tourism".

推荐答案

Two ways:

1.Escape it with another ampersand (&&)
    put 2 ampersand symbol continuosly.

2.Set UseMnemonic for that label to false, then all ampersands for that label will be taken literally and you don't need to double them.






你可以在标签属性Text中键入你想要的任何符号,这样你就可以在html中获得转换



ex :如果你在属性窗口中写''。你会得到和引用html..etc ..



谢谢

Pramod.K
Hi,

you can type whatever symbol you want in label property Text, so you will get conversion in html

ex: if you write in '' in the property window. you will get "e in html..etc..

thanks
Pramod.K






我认为你在Windows应用程序中遇到这个问题:



如果你使用&任何文本/字母前面的符号,然后就像该按钮的快捷方式。所以使用&& (双&)显示&在任何标签或按钮控件中。



ex:
Hi,

I think you facing this problem in Windows app:

If you use & symbol in front of any text/alphabet , then works like a shortcut for that button. So use && (double &) to display & in any label or button control.

ex:
Label1.Text="Thanks && Regards";


这篇关于如何放置& c#标签盒中的符号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆