如何使用&添加字符串标签? [英] how to add string with & for label?

查看:51
本文介绍了如何使用&添加字符串标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我是VB.net的新手
有身体可以帮助我吗?

Hi guys, i''m new for VB.net
Any body help me?

Dim a As String = "Hello & Welcome"
      Label1.Text = a



上面的代码为label1显示"HelloWelcome".

那么如何获取label1的"Hello& Welcome"?



The code above display " HelloWelcome" for label1

so how to get "Hello & Welcome" for label1?

推荐答案

找到了 ^ ]对此进行了说明.
要么打开 UseMnemonic [ 希望能帮助到你! :)
Found this blog[^] which explains it.
Either turn UseMnemonic[^] off or use a double ampersand "&&" which simply shows one.
Hope it helps! :)


Uday P.Singh是对的.如果您使用双与号,则更简单:
Hi, Uday P.Singh is right. Much simpler if you use double ampersand like this:
Dim a As String = "Hello && Welcome"
        Label1.Text = a


这篇关于如何使用&添加字符串标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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