Character '&' not being shown in a label in windows forms

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sam1ri
    New Member
    • Apr 2020
    • 1

    Character '&' not being shown in a label in windows forms

    I am trying to put with code this character '&' in a label with windows forms, but it displays an empty label. Any guess what could be the problem?
  • Luuk
    Recognized Expert Top Contributor
    • Mar 2012
    • 1043

    #2
    Try to escape this by putting a '\' in front of it.

    EDIT: stupid /me, i should have know better...
    A 'a&b' on a label produces 'a\b'

    Comment

    • SioSio
      Contributor
      • Dec 2019
      • 272

      #3
      If you want to display "&" in a label, put "&&".

      Comment

      Working...