如何在C#中的System.Windows.Forms.Button上放置unicode字符?

时间:2022-02-24 21:10:59

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".

在C#WinForms项目的Visual Studio 2008中,表单上有一个按钮。在属性视图中,属性“Font”设置为“Arial Unicode MS”。

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

我需要在属性“Text”中放入什么,所以我得到按钮上显示的unicode字符\ u0D15?

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

当我将\ u0D15放入“Text”属性时,该按钮显示六个字符“\ u0D15”而不是一个unicode字符。

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

在以下PDF中,您可以看到\ u0D15的unicode字符:http://unicode.org/charts/PDF/U0D00.pdf

2 个解决方案

#1


7  

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:

您不必在字符串中转义unicode字符,因为C#本质上是unicode。只需将你的unicode字符放入字符串即可。例如:

button1.Text = "日本";

#2


0  

One possible way is to run "charmap" and copypaste from there or copypaste it from elsewhere.

一种可能的方法是从那里运行“charmap”和copypaste,或从其他地方进行copypaste。

#1


7  

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:

您不必在字符串中转义unicode字符,因为C#本质上是unicode。只需将你的unicode字符放入字符串即可。例如:

button1.Text = "日本";

#2


0  

One possible way is to run "charmap" and copypaste from there or copypaste it from elsewhere.

一种可能的方法是从那里运行“charmap”和copypaste,或从其他地方进行copypaste。