Click here to Skip to main content
15,887,248 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys, i'm new for VB.net
Any body help me?

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


The code above display " HelloWelcome" for label1

so how to get "Hello & Welcome" for label1?
Posted
Updated 3-Mar-12 23:50pm
v2

Found this blog[^] which explains it.
Either turn UseMnemonic[^] off or use a double ampersand "&&" which simply shows one.
Hope it helps! :)
 
Share this answer
 
Comments
Uday P.Singh 4-Mar-12 5:55am    
5!
Sander Rossel 4-Mar-12 5:58am    
Thanks! :)
Long Bunly 4-Mar-12 6:17am    
Thanks :)
Sander Rossel 4-Mar-12 6:33am    
No problem :)
Hi, Uday P.Singh is right. Much simpler if you use double ampersand like this:
VB
Dim a As String = "Hello && Welcome"
        Label1.Text = a
 
Share this answer
 
Comments
Long Bunly 4-Mar-12 6:17am    
Thanks :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900