Computing.Net > Forums > Programming > display ampersand in VB

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

display ampersand in VB

Reply to Message Icon

Name: Rich
Date: October 1, 2003 at 19:29:12 Pacific
OS: 2000 pro
CPU/Ram: p3 500
Comment:

I know that an ampersand displays an underscore for keyboard access in labels and text boxes in VB. I'm wanting to display the & symbol in a label such as "tow & garage". Is it possible to do this, and how?
Thanks - Rich



Sponsored Link
Ads by Google

Response Number 1
Name: SN
Date: October 1, 2003 at 21:25:23 Pacific
Reply:

I don't know VB, but for many languages, when you want the program/compiler to disregard the usual meaning of a character and just treat it as an ascii char, you can escape it with a backslash.

print "tow \& garage";

This may or may not hold true for VB. I believe you may also be able to do it by printing out the value of chr(38) (38 is the ascii value of the ampersand sign.)

print "tow "
print chr(38)
print " garage"

Good luck,
SN


0

Response Number 2
Name: egkenny
Date: October 1, 2003 at 21:28:16 Pacific
Reply:

"tow && garage"


0

Response Number 3
Name: SN
Date: October 1, 2003 at 21:30:34 Pacific
Reply:

Thanks kenny-There's been such a lack of posts I know anything about I've been forced to just answer ones I can only guess at:-) Of course, I could just learn more, but that would involve work...
-SN


0

Response Number 4
Name: Rich
Date: October 2, 2003 at 21:21:33 Pacific
Reply:

OK, thanks guys that worked great!


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: display ampersand in VB

random function in VB www.computing.net/answers/programming/random-function-in-vb/12282.html

CRviewer control in VB 6 www.computing.net/answers/programming/crviewer-control-in-vb-6/580.html

Animation in VB www.computing.net/answers/programming/animation-in-vb/6606.html