Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# Button Text Unicode characters

C# doesn't want to put Unicode characters on buttons. If I put \u2129 in the Text attribute of the button, the button displays the \u2129, not the Unicode character, (example - I chose 2129 because I could see it in the font currently active on the machine).

I saw this question before, link text, but the question isn't really answered, just got around. I am working on applications which are going all over the world, and don't want to install all the fonts, more then "don't want", there are that many that I doubt the machine I am working on has sufficient disk space. Our overseas sales agents supply the Unicode character "numbers". Is there another way forward with this?

As an aside, (curiosity), why does it not work?

like image 626
Fossaw Avatar asked Mar 24 '10 10:03

Fossaw


2 Answers

The issue is:

  • C# will let you put Unicode in, like button1.Text = "Hello \u2129";, no problem
  • but the Visual Studio Forms designer will not recognize '\u2129' as anything special. By design.

So just paste in the '℩' in the Properties Window or use code.

like image 102
Henk Holterman Avatar answered Sep 21 '22 19:09

Henk Holterman


Change the "Font" of the button to the "Font" (From google:Arial Unicode MS) which supports "u2129". It may help you

like image 42
prabhakaran Avatar answered Sep 19 '22 19:09

prabhakaran