Results 1 to 4 of 4

Thread: Displaying '&' in Label

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2000
    Location
    Sussex, England
    Posts
    45

    Cool

    I'm trying to display a text field from an SQL database in a VB label, eveything works fine apart from the fact the '&' symbol shows up as a '_'. I'm sure this is something to do with '&' being a special character in VB so how do i actually get it to display ???

    Regards
    Ian (New Guy!)

  2. #2
    Hyperactive Member
    Join Date
    Jul 2000
    Location
    Halifax,UK
    Posts
    274
    You need to put '&&' to show a single &.

    If it is in a database field you will need to replace all &'s with &&.

    regards

    Chris
    VB6 VS2005

  3. #3

    Thread Starter
    Member
    Join Date
    Oct 2000
    Location
    Sussex, England
    Posts
    45

    Smile

    Thanks Chris, i figured it would be something silly like that but could'nt seem to find the answer ...

    Ian.

  4. #4
    Guest
    The other option is to turn off the UseMnemonic property (make it false). That stops VB interpreting the & as an underline. A lot easier than search adn replace

    - gaffa

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width