Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. "&" string cant display in Lable control

"&" string cant display in Lable control

Scheduled Pinned Locked Moved C#
databasequestion
8 Posts 6 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    ASysSolvers
    wrote on last edited by
    #1

    I have a value comes from data base like, Mr & Mrs. Taniya and displaying it in a Lable Control Lable1.Text = value; // string value comes from database. But result display without "&" mark i need to display it.. I Cant use two "&&" for that any solution??

    G G N 3 Replies Last reply
    0
    • A ASysSolvers

      I have a value comes from data base like, Mr & Mrs. Taniya and displaying it in a Lable Control Lable1.Text = value; // string value comes from database. But result display without "&" mark i need to display it.. I Cant use two "&&" for that any solution??

      G Offline
      G Offline
      Gareth H
      wrote on last edited by
      #2

      Try: & amp; (but without the space, i added the space since CP changes it to the and sign)

      Regards, Gareth. (FKA gareth111)

      L 1 Reply Last reply
      0
      • G Gareth H

        Try: & amp; (but without the space, i added the space since CP changes it to the and sign)

        Regards, Gareth. (FKA gareth111)

        L Offline
        L Offline
        leppie
        wrote on last edited by
        #3

        Gareth H wrote:

        Try: & amp;

        Loverly, a HTML answer for a Winforms question... :sigh:

        xacc.ide - now with TabsToSpaces support
        IronScheme - 1.0 alpha 4a out now (29 May 2008)

        1 Reply Last reply
        0
        • A ASysSolvers

          I have a value comes from data base like, Mr & Mrs. Taniya and displaying it in a Lable Control Lable1.Text = value; // string value comes from database. But result display without "&" mark i need to display it.. I Cant use two "&&" for that any solution??

          G Offline
          G Offline
          Guffa
          wrote on last edited by
          #4

          ASysSolvers wrote:

          I Cant use two "&&" for that any solution?

          Why not? That's the way you display an & in a label. A single & is used to specify a shortcut key, and && is used to display & in the label.

          Despite everything, the person most likely to be fooling you next is yourself.

          L 1 Reply Last reply
          0
          • G Guffa

            ASysSolvers wrote:

            I Cant use two "&&" for that any solution?

            Why not? That's the way you display an & in a label. A single & is used to specify a shortcut key, and && is used to display & in the label.

            Despite everything, the person most likely to be fooling you next is yourself.

            L Offline
            L Offline
            leppie
            wrote on last edited by
            #5

            Guffa wrote:

            Why not?

            I suspect the forces of nature is preventing him ;P

            xacc.ide - now with TabsToSpaces support
            IronScheme - 1.0 alpha 4a out now (29 May 2008)

            1 Reply Last reply
            0
            • A ASysSolvers

              I have a value comes from data base like, Mr & Mrs. Taniya and displaying it in a Lable Control Lable1.Text = value; // string value comes from database. But result display without "&" mark i need to display it.. I Cant use two "&&" for that any solution??

              N Offline
              N Offline
              Nirandas
              wrote on last edited by
              #6

              Try setting the UseMnemonic property of the Label to true. I believe your developing a desktop application. Right?

              Nirandas, a developer from India. http://www.nirandas.com

              J 1 Reply Last reply
              0
              • N Nirandas

                Try setting the UseMnemonic property of the Label to true. I believe your developing a desktop application. Right?

                Nirandas, a developer from India. http://www.nirandas.com

                J Offline
                J Offline
                J 0
                wrote on last edited by
                #7

                Nirandas wrote:

                Try setting the UseMnemonic property of the Label to true.

                You're going to want to set the UseMnemonic property to false, not true to get the ampersand to display in the label's Text property.

                A 1 Reply Last reply
                0
                • J J 0

                  Nirandas wrote:

                  Try setting the UseMnemonic property of the Label to true.

                  You're going to want to set the UseMnemonic property to false, not true to get the ampersand to display in the label's Text property.

                  A Offline
                  A Offline
                  ASysSolvers
                  wrote on last edited by
                  #8

                  It is working fine, Thank U very much for all.

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups