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. very simple question: what is the purpose of & in ""

very simple question: what is the purpose of & in ""

Scheduled Pinned Locked Moved C#
questioncsharp
3 Posts 3 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.
  • D Offline
    D Offline
    dino2094
    wrote on last edited by
    #1

    I just started C# 2 weeks ago and I'm loving it. One simple question. btnStart.Text = "&Start"; What is the purpose of the &. Thank you to the forum, you guys / gals are great.

    S L 2 Replies Last reply
    0
    • D dino2094

      I just started C# 2 weeks ago and I'm loving it. One simple question. btnStart.Text = "&Start"; What is the purpose of the &. Thank you to the forum, you guys / gals are great.

      S Offline
      S Offline
      Stefan Troschuetz
      wrote on last edited by
      #2

      Normally you use the "&" when naming menu items. If you run your program the character preceded by the ampersand is underlined in every menu item and you can "simulate" clicking the menu item by pressing the respective character whilst holding Alt. So it allows users to access the menu without using the mouse.


      "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook

      www.troschuetz.de

      1 Reply Last reply
      0
      • D dino2094

        I just started C# 2 weeks ago and I'm loving it. One simple question. btnStart.Text = "&Start"; What is the purpose of the &. Thank you to the forum, you guys / gals are great.

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        If you use &Start, then if you press Alt, the "S" will be underlined.

        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