Click to See Complete Forum and Search --> : Display "&" character in label control


inzaghi_isazi
July 2nd, 2008, 02:01 AM
Hi,

I have a string which has a "&" character. Example, "Electrical & Electronic". When I execute a form, the "&" character does not show on label control of the form. Only the words "Electrical Electronic" were display. Anybody know what is the problem?

TQ.

WillAtwell
July 2nd, 2008, 02:14 AM
I haven't tried it in dot net but in VB to display a & you use && a single & tells it to underline the next character. && tells it to display the &. much like you need to use "" to display a ". Not sure but you could probably use the ascii value in the form of a chr() statement as well.

HanneSThEGreaT
July 2nd, 2008, 09:22 AM
WillAtwell is correct, you're going to need to have it as :
Label1.Text = "Electrical && Electronic"