CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2007
    Posts
    10

    Talking Display "&" character in label control

    Hi,

    I have a string which has a "&" character. Example, "Electrical & Electronic". When I execute a form, the "&" character does not show on label control of the form. Only the words "Electrical Electronic" were display. Anybody know what is the problem?

    TQ.

  2. #2
    Join Date
    May 2008
    Posts
    224

    Re: Display "&" character in label control

    I haven't tried it in dot net but in VB to display a & you use && a single & tells it to underline the next character. && tells it to display the &. much like you need to use "" to display a ". Not sure but you could probably use the ascii value in the form of a chr() statement as well.

  3. #3
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,284

    Re: Display "&" character in label control

    WillAtwell is correct, you're going to need to have it as :
    Code:
            Label1.Text = "Electrical && Electronic"

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

Featured