Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show symbols like "Lambda" or "Mu" on labels in desktop application in c#.net

Tags:

c#

symbols

Please tell me how can i show symbols like "lambda" or Mu using c#.net in desktop application. what i think is we may do it using ASCII values and convert.toChar();.. if i am right that please give me link of page where i can get ASCII values of all such a scientific symbols.

Please give me link of any URL which contains list of such a ASCII numbers.

like image 998
Dr. Rajesh Rolen Avatar asked Dec 03 '22 05:12

Dr. Rajesh Rolen


2 Answers

Open the Windows character map (charmap.exe), select a Unicode font (Arial should suffice) and copy the symbols into your source code or resources. It's just characters. Of course, you can also switch to Greek keyboard layout, so you can write the characters directly rather than going the charmap route.

Note that you need to use a Unicode font for the labels. You can use charmap to look up which font has Greek characters.

like image 147
OregonGhost Avatar answered Dec 20 '22 01:12

OregonGhost


Please tell me how can i show symbols like "lambda" or Mu using c#.net in desktop application.

You don't have to do anything special. Just use whatever letters you want in either the IDE or in strings in the program. C# treats Greek letters the same as any other letters; they are not special.

what i think is we may do it using ASCII values and convert.toChar();

Hold on, I have a phone call. Oh, it's for you. It's 1968 calling, and they want their character set back. :-)

ASCII proper only has 95 printable characters, and Greek letters are not among them. ASCII was invented for teletypes back in the 1960's; we don't use it anymore. Characters in modern programming environments are represented using Unicode, which provides uniform support for tens of thousands of characters in dozens of alphabets.

if i am right then please give me link of page where i can get ASCII values of all such a scientific symbols.

You can get a list of all the Unicode characters at unicode.org. But like I said, you don't need to. You can just embed the character you want directly in the text. There's no need to resort to clumsy tricks like unicode escapes. (Unless, of course, you are planning on sending your source code to your coworkers using a 1970's era teletype machine.)

like image 34
Eric Lippert Avatar answered Dec 20 '22 01:12

Eric Lippert