如何将unicode字符放在C#中的System.Windows.Forms.Button? [英] How to put unicode characters on a System.Windows.Forms.Button in C#?

查看:156
本文介绍了如何将unicode字符放在C#中的System.Windows.Forms.Button?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

我需要放入属性Text \ u0D15显示在按钮上?

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

当我将\\\ക放入Text属性时,按钮显示六个字符\\\ക

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

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

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

推荐答案

你不必在字符串中转义你的unicode字符,因为C#是固有的unicode。只需把你的unicode字符,因为他们是字符串。例如:

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 = "日本";

这篇关于如何将unicode字符放在C#中的System.Windows.Forms.Button?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆