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. label problem

label problem

Scheduled Pinned Locked Moved C#
csharphelpquestion
10 Posts 5 Posters 0 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.
  • K Offline
    K Offline
    KUNWAR999
    wrote on last edited by
    #1

    hey guys,.. i am doing my mini project in c# windows form application .. in that i used a label l in form.when l.Text= "&"; its not showing anything on form inplace of label. Can anyone knows solution for it??

    F M 2 Replies Last reply
    0
    • K KUNWAR999

      hey guys,.. i am doing my mini project in c# windows form application .. in that i used a label l in form.when l.Text= "&"; its not showing anything on form inplace of label. Can anyone knows solution for it??

      F Offline
      F Offline
      fjdiewornncalwe
      wrote on last edited by
      #2

      You can try a couple of things. (Note: I haven't tried them to make sure they all work. I just thought I'd throw out the ideas for you.)

      a.Text = @"&";
      a.Text = "\&";
      a.Text = "& # 3 8;"; // Don't put the spaces between the characters. I just did that because otherwise you would just see the & and not the &# 38;";
      a.Text = &

      I wasn't, now I am, then I won't be anymore.

      K 1 Reply Last reply
      0
      • K KUNWAR999

        hey guys,.. i am doing my mini project in c# windows form application .. in that i used a label l in form.when l.Text= "&"; its not showing anything on form inplace of label. Can anyone knows solution for it??

        M Offline
        M Offline
        Matt U
        wrote on last edited by
        #3

        Strange. I copy/pasted your code bit. And MessageBox displays the '&'. What version of Windows, maybe?

        djj55: Nice but may have a permission problem Pete O'Hanlon: He has my permission to run it.

        K 1 Reply Last reply
        0
        • M Matt U

          Strange. I copy/pasted your code bit. And MessageBox displays the '&'. What version of Windows, maybe?

          djj55: Nice but may have a permission problem Pete O'Hanlon: He has my permission to run it.

          K Offline
          K Offline
          KUNWAR999
          wrote on last edited by
          #4

          sorry, my fault.. actually i have asked wrong question.. i have updated my question.. can u pls answer for it.. ?? thank u

          M 1 Reply Last reply
          0
          • F fjdiewornncalwe

            You can try a couple of things. (Note: I haven't tried them to make sure they all work. I just thought I'd throw out the ideas for you.)

            a.Text = @"&";
            a.Text = "\&";
            a.Text = "& # 3 8;"; // Don't put the spaces between the characters. I just did that because otherwise you would just see the & and not the &# 38;";
            a.Text = &

            I wasn't, now I am, then I won't be anymore.

            K Offline
            K Offline
            KUNWAR999
            wrote on last edited by
            #5

            sorry, my fault.. actually i have asked wrong question.. i have updated my question.. can u pls answer for it.. ?? thank u

            1 Reply Last reply
            0
            • K KUNWAR999

              sorry, my fault.. actually i have asked wrong question.. i have updated my question.. can u pls answer for it.. ?? thank u

              M Offline
              M Offline
              Matt U
              wrote on last edited by
              #6

              Oh, that is because the & symbol, when used in text on certain controls (i.e. buttons, menus, labels), the following character has a Mnemonic beneath it. In the designer (or in code), set the "UseMnemonic" property of the label control to 'false'.

              djj55: Nice but may have a permission problem Pete O'Hanlon: He has my permission to run it.

              K G 2 Replies Last reply
              0
              • M Matt U

                Oh, that is because the & symbol, when used in text on certain controls (i.e. buttons, menus, labels), the following character has a Mnemonic beneath it. In the designer (or in code), set the "UseMnemonic" property of the label control to 'false'.

                djj55: Nice but may have a permission problem Pete O'Hanlon: He has my permission to run it.

                K Offline
                K Offline
                KUNWAR999
                wrote on last edited by
                #7

                thnk u.. its working now.. :) :) can u tell me other text exmples which have this mnemonic beneath??

                B 1 Reply Last reply
                0
                • M Matt U

                  Oh, that is because the & symbol, when used in text on certain controls (i.e. buttons, menus, labels), the following character has a Mnemonic beneath it. In the designer (or in code), set the "UseMnemonic" property of the label control to 'false'.

                  djj55: Nice but may have a permission problem Pete O'Hanlon: He has my permission to run it.

                  G Offline
                  G Offline
                  GenJerDan
                  wrote on last edited by
                  #8

                  And, I think, just putting it in as && will make it show up.

                  No dogs or cats are in the classroom. My Mu[sic] My Films My Windows Programs, etc.

                  M 1 Reply Last reply
                  0
                  • G GenJerDan

                    And, I think, just putting it in as && will make it show up.

                    No dogs or cats are in the classroom. My Mu[sic] My Films My Windows Programs, etc.

                    M Offline
                    M Offline
                    Matt U
                    wrote on last edited by
                    #9

                    I think the && would, too, thanks for adding the idea. It seems like it wouldn't matter in this case but if he is actually using the mnemonics in the application it would add the line beneath the '&' that is printed on the control. Not sure if it would be a problem but it is possible.

                    djj55: Nice but may have a permission problem Pete O'Hanlon: He has my permission to run it.

                    1 Reply Last reply
                    0
                    • K KUNWAR999

                      thnk u.. its working now.. :) :) can u tell me other text exmples which have this mnemonic beneath??

                      B Offline
                      B Offline
                      BobJanova
                      wrote on last edited by
                      #10

                      Anything which can take focus from an Alt+X keystroke. That is buttons, labels, menus and menu items, radio and check box buttons, groups (I think), toolbar equivalents and possibly also grid view inner control equivalents (not sure about that), off the top of my head.

                      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