c# - Enter "&" symbol into a text Label in Windows Forms? -
how 1 enter special characters label
in c# (windows forms)?
if try write "&" label you'll sort of underscore instead..
so what's c# equivalent of "&"? ("\&" doesn't work).
two ways:
escape ampersand (
&&
).set
usemnemonic
labelfalse
. causes ampersands within text taken literally don't need double of them. you'll lose underlining , access key features though.you can set value either in designer, or in code:
mylabel.usemnemonic = false; mylabel.text = "text&text";
Comments
Post a Comment