|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
"&&" string curiosityIf you paste the following four statements into the form_load sub of a
new VB6 Standard EXE and add a label, a text box, and a command button, you will find on running the program that sometimes (captions in labels and on command buttons) the string "&&" will appear as one ampersand and sometimes as two. This was a surprise to me and it made me wonder what the logic is behind the behavior. Does anyone know why this happens and why it happens only sometimes?? I could understand ampersand being an escape character but the inconsistency throws me! Label1.Caption = "x&&abc" Text1.Text = "x&&def" Command1.Caption = "x&&him" Form1.Caption = "x&&klm" -- Rich Raffenetti
Show quote
Hide quote
"Rich Raffenetti" <rich@raffenetti_takethisout.com> wrote in message Ampersand is the escape character used to signal access key characters in news:Oe2a%23n3$JHA.3784@TK2MSFTNGP05.phx.gbl... > If you paste the following four statements into the form_load sub of a > new VB6 Standard EXE and add a label, a text box, and a command button, > you will find on running the program that sometimes (captions in labels > and on command buttons) the string "&&" will appear as one ampersand and > sometimes as two. > This was a surprise to me and it made me wonder what the logic is > behind the behavior. Does anyone know why this happens and why it happens > only sometimes?? I could understand ampersand being an escape character > but the inconsistency throws me! > > Label1.Caption = "x&&abc" > Text1.Text = "x&&def" > Command1.Caption = "x&&him" > Form1.Caption = "x&&klm" > > -- > Rich Raffenetti Caption properties. To self-escape it to include an ampersand symbol in such properties you double it as &&. This is just as described in the VB6 docs. Look in the Language Reference under Caption Property. Hi Rich,
It should appear as && in the textbox, but on command buttons and labels and especially menus, a single & goes before the letter to underline. (on most new default window setups, the user has to press ALT before the mnemonics display) Show quoteHide quote "Rich Raffenetti" <rich@raffenetti_takethisout.com> wrote in message news:Oe2a%23n3$JHA.3784@TK2MSFTNGP05.phx.gbl... > If you paste the following four statements into the form_load sub of a > new VB6 Standard EXE and add a label, a text box, and a command button, > you will find on running the program that sometimes (captions in labels > and on command buttons) the string "&&" will appear as one ampersand and > sometimes as two. > This was a surprise to me and it made me wonder what the logic is > behind the behavior. Does anyone know why this happens and why it happens > only sometimes?? I could understand ampersand being an escape character > but the inconsistency throws me! > > Label1.Caption = "x&&abc" > Text1.Text = "x&&def" > Command1.Caption = "x&&him" > Form1.Caption = "x&&klm" > > -- > Rich Raffenetti "Bill McCarthy" <TPASoft.com Are Identity Thieves>'s wild thoughts were released on Wed, 8 Jul 2009 17:37:24 +1000bearing the following fruit: > In addition, if UseMnumonic (spelling!) is set to false then>Hi Rich, > >It should appear as && in the textbox, but on command buttons and labels and >especially menus, a single & goes before the letter to underline. (on most >new default window setups, the user has to press ALT before the mnemonics >display) the label too would show '&&' J Show quoteHide quote >"Rich Raffenetti" <rich@raffenetti_takethisout.com> wrote in message >news:Oe2a%23n3$JHA.3784@TK2MSFTNGP05.phx.gbl... >> If you paste the following four statements into the form_load sub of a >> new VB6 Standard EXE and add a label, a text box, and a command button, >> you will find on running the program that sometimes (captions in labels >> and on command buttons) the string "&&" will appear as one ampersand and >> sometimes as two. >> This was a surprise to me and it made me wonder what the logic is >> behind the behavior. Does anyone know why this happens and why it happens >> only sometimes?? I could understand ampersand being an escape character >> but the inconsistency throws me! >> >> Label1.Caption = "x&&abc" >> Text1.Text = "x&&def" >> Command1.Caption = "x&&him" >> Form1.Caption = "x&&klm" >> >> -- >> Rich Raffenetti -- Jan Hyde "Jan Hyde" <StellaDrin***@REMOVE.ME.uboot.com> wrote in message Mnemonic.news:7rq8555lfj9bcl7klkjcqq2b20cb3dtia4@4ax.com... > In addition, if UseMnumonic (spelling!) Many people seem to think this word is pronounced like "pneumonia." It is not. It's more like "anemone." Remember that and you'll never think there's supposed to be a "u" in it! "Jeff Johnson" <i.get@enough.spam> wrote in message According to Merriam-Webster...news:%23O1Lx28$JHA.1488@TK2MSFTNGP03.phx.gbl... > "Jan Hyde" <StellaDrin***@REMOVE.ME.uboot.com> wrote in message > news:7rq8555lfj9bcl7klkjcqq2b20cb3dtia4@4ax.com... > >> In addition, if UseMnumonic (spelling!) > > Mnemonic. > > Many people seem to think this word is pronounced like "pneumonia." It is > not. It's more like "anemone." Remember that and you'll never think > there's supposed to be a "u" in it! > Main Entry:1mne·mon·ic Pronunciation:\ni-'mä-nik\ Function:adjective Etymology:Greek mnemonikos, from mnemon mindful, from mimneskesthai to remember - more at mind Date:1753 1: assisting or intended to assist memory ; also : of or relating to mnemonics 2: of or relating to memory -- Mike "Jeff Johnson" <i.get@enough.spam>'s wild thoughts were released on Wed, 8 Jul 2009 09:12:04 -0400 bearing thefollowing fruit: > Even if I did remember that I doubt it would help with my>"Jan Hyde" <StellaDrin***@REMOVE.ME.uboot.com> wrote in message >news:7rq8555lfj9bcl7klkjcqq2b20cb3dtia4@4ax.com... > >> In addition, if UseMnumonic (spelling!) > >Mnemonic. > >Many people seem to think this word is pronounced like "pneumonia." It is >not. It's more like "anemone." Remember that and you'll never think there's >supposed to be a "u" in it! > terrible spelling ;-P -- Jan Hyde Thanks all for the wisdom about &&. I just don't have the right reference
material. I appreciate finding out about useMnemonic. Rich Show quoteHide quote "Jan Hyde" <StellaDrin***@REMOVE.ME.uboot.com> wrote in message news:7rq8555lfj9bcl7klkjcqq2b20cb3dtia4@4ax.com... > "Bill McCarthy" <TPASoft.com Are Identity Thieves>'s wild > thoughts were released on Wed, 8 Jul 2009 17:37:24 +1000 > bearing the following fruit: > >> >>Hi Rich, >> >>It should appear as && in the textbox, but on command buttons and labels >>and >>especially menus, a single & goes before the letter to underline. (on most >>new default window setups, the user has to press ALT before the mnemonics >>display) > > In addition, if UseMnumonic (spelling!) is set to false then > the label too would show '&&' > > J > >>"Rich Raffenetti" <rich@raffenetti_takethisout.com> wrote in message >>news:Oe2a%23n3$JHA.3784@TK2MSFTNGP05.phx.gbl... >>> If you paste the following four statements into the form_load sub of a >>> new VB6 Standard EXE and add a label, a text box, and a command button, >>> you will find on running the program that sometimes (captions in labels >>> and on command buttons) the string "&&" will appear as one ampersand and >>> sometimes as two. >>> This was a surprise to me and it made me wonder what the logic is >>> behind the behavior. Does anyone know why this happens and why it >>> happens >>> only sometimes?? I could understand ampersand being an escape character >>> but the inconsistency throws me! >>> >>> Label1.Caption = "x&&abc" >>> Text1.Text = "x&&def" >>> Command1.Caption = "x&&him" >>> Form1.Caption = "x&&klm" >>> >>> -- >>> Rich Raffenetti > > -- > Jan Hyde -- Rich Raffenetti "Rich Raffenetti" <rich@raffenetti_takethisout.com> wrote The documentation is free:> Thanks all for the wisdom about &&. I just don't have the right reference > material. I appreciate finding out about useMnemonic. http://msdn.microsoft.com/en-us/library/dd430246.aspx Specifically: http://msdn.microsoft.com/en-us/library/aa445754(VS.60).aspx LFS
Other interesting topics
dhrichclient3 requests
best way to write a VB-app with several languages VB Express and VB files Keeping 2 listboxes in sync - VB6 ListBox - Limit Selection Rectangle Width In-Process and Out-of-Process Best method to have 2 checkboxes for 1 item array dimensions and size error Command Line Executing Adobe script listener code in VB6 |
|||||||||||||||||||||||