Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

visual studio - How to put unicode characters on a System.Windows.Forms.Button in C#?

In Visual Studio 2008 in a C# WinForms project, there is a button on a form. In the properties view, the property "Font" is set to "Arial Unicode MS".

What do I need to put into the property "Text", so I get the unicode character u0D15 displayed on the button?

When I put u0D15 into the "Text" property, the button displays the six characters "u0D15" instead of one unicode character.

In the following PDF, you can see the unicode character for u0D15: http://unicode.org/charts/PDF/U0D00.pdf

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You don't have to escape your unicode characters in strings as C# is inherently unicode. Just put your unicode characters as they are into the string. For example:

button1.Text = "日本";

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...