|
-
Nov 6th, 2000, 01:07 PM
#1
Thread Starter
Hyperactive Member
Hi,
When you use an ampersand (&) symbol in a string, VB converts it to an underscore (_). How can I prevent it. I need to display an ampersand in a lable control.
Thanks
-
Nov 6th, 2000, 01:14 PM
#2
Frenzied Member
Code:
MsgBox "this does look like an ampersand huh? " & Chr(38) & " yep, it is! :)"
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
-
Nov 6th, 2000, 01:17 PM
#3
Frenzied Member
Jop your code doesn't show tha ampresand in a Label
Use This
Code:
Label1.Caption = "this does look like an ampersand huh? && yep, it is! "
Two ampresands will show one
-
Nov 6th, 2000, 01:18 PM
#4
Frenzied Member
&& will put an ampresand
label1.caption = "hello&&bye"
-
Nov 6th, 2000, 01:25 PM
#5
Frenzied Member
Hey you're right guys hehe dumb to only test it with a msgbox
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
-
Nov 6th, 2000, 03:46 PM
#6
Just set the label's UseMnemonic property to False.
-
Jan 20th, 2010, 05:20 PM
#7
New Member
Re: Displaying '&' character instead of an underscore
Label1.CAption = "This is a right answer &&"
-
Jan 20th, 2010, 05:32 PM
#8
PowerPoster
Re: Displaying '&' character instead of an underscore
Label1.Caption = "This is a 10 year old thread"
Well, everyone else has been doing it :-)
Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
Expect more to come in future
If I have helped you, RATE ME! :-)
I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!
And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.
-
Jan 20th, 2010, 06:26 PM
#9
Re: Displaying '&' character instead of an underscore
 Originally Posted by smUX
Label1.Caption = "This is a 10 year old thread"
-
Jan 20th, 2010, 07:29 PM
#10
New Member
Re: Displaying '&' character instead of an underscore
Really? The asker is still alive?
-
Jan 20th, 2010, 07:33 PM
#11
Re: Displaying '&' character instead of an underscore
 Originally Posted by smUX
Label1.Caption = "This is a 10 year old thread"
Perhaps you could at least punctuate the caption correctly.
-
Jan 20th, 2010, 07:44 PM
#12
Thread Starter
Hyperactive Member
Re: Displaying '&' character instead of an underscore
I'm alive && well, thank you very much
-
Jan 20th, 2010, 07:48 PM
#13
Re: Displaying '&' character instead of an underscore
 Originally Posted by Tomexx
I'm alive && well, thank you very much 
Well, this thread just made my day !!
-
Jan 20th, 2010, 09:09 PM
#14
Re: Displaying '&' character instead of an underscore
 Originally Posted by LaVolpe
Well, this thread just made my day !!
This post actually helped me realize when using DrawText API I need to include DT_NOPREFIX flag or "&" are shown as "_" too.
Until everyone stops coding in VB6 there is no such thing as an old thread.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|