Article View: comp.os.ms-windows.programmer.tools
Article #105Re: & in label fields in VB
From: Howard Pell
Date: Thu, 06 Aug 1992 04:03
Date: Thu, 06 Aug 1992 04:03
31 lines
1895 bytes
1895 bytes
aliamus@hpcc01.corp.hp.com (Steve Aliamus) writes: I have the same problem and I fiddled with it for some time. I finally settled on reading each character in the string and if it is & then I insert another & into the string. It stinks but that's all I could come up with. In the KeyPress routine say something like: if KeyAscii = Asc(38) then label1.caption = label1.caption + keyAscii endif If you hear of a better way please let us all know. >I am using Visual Basic to create a form that will display data >in a label field. The data is unformatted text, and many times >includes the "&" character, causing the next character to be underlined. >So, instead of "A&B" displaying in the label field, I get "AB". > - >Is there a way to tell a label field to *not* draw an underline when >it sees an "&"? My workaround up to this point is to create text >fields that cannot be tabbed to, or to simply change a single "&" to >"&&" before assigning the label.caption. But, I'd really like to use >label fields if possible, especially since one form I've developed >already has 50+ such fields. >Any ideas would be appreciated. >Thanks >Steve Aliamus | Phone: 415-857-7927 >Hewlett-Packard | FAX: 415-857-4586 >3000 Hanover Street MS 20CAA | HPDesk: HP0000/49 >Palo Alto, California, USA 94304 | UNIX: aliamus@corp.hp.com
Technical Details
Message-ID:
<1992Aug6.040329.16447@torsqnt.tor.sequent.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!elroy.jpl.nasa.gov!usc!rpi!utcsri!torsqnt!hlpellReferences:
<70560001@hpcc01.corp.hp.com>Show Full Headers
Complete Article Headers
Newsgroups: comp.os.ms-windows.programmer.tools Path: arc1-ca.pugleaf.net!sparky!uunet!elroy.jpl.nasa.gov!usc!rpi!utcsri!torsqnt!hlpell From: hlpell@torsqnt.tor.sequent.com (Howard Pell) Subject: Re: & in label fields in VB Message-ID: <1992Aug6.040329.16447@torsqnt.tor.sequent.com> Organization: Sequent Computer Systems (Canada) Ltd. References: <70560001@hpcc01.corp.hp.com> Date: Thu, 6 Aug 1992 04:03:29 GMT Lines: 31