vb.net Windows 窗体中的 TextBox 不显示 Unicode 字符

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14000959/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-17 11:39:38  来源:igfitidea点击:

TextBox in Windows Forms does not display Unicode characters

.netvb.netwinformsunicode

提问by Lenin Raj Rajasekaran

I have a Unicode character in the settings of a VB.NET application.

我在 VB.NET 应用程序的设置中有一个 Unicode 字符。

unicode in settings

设置中的 unicode

With the following code:

使用以下代码:

CurrencyText.Text = My.Settings.Options_Display_Currency

I try to render this value in a text box with Calibri font, I see a box like this:

我尝试在带有 Calibri 字体的文本框中呈现此值,我看到一个这样的框:

enter image description here

在此处输入图片说明

How to enable the Windows Form to display Unicode characters?

如何让 Windows 窗体显示 Unicode 字符?

回答by Esailija

It means the font used to display the character doesn't contain glyph for the character. Try a font like Arial or any font listed here http://www.fileformat.info/info/unicode/char/20b9/fontsupport.htm

这意味着用于显示字符的字体不包含字符的字形。尝试使用 Arial 等字体或此处列出的任何字体http://www.fileformat.info/info/unicode/char/20b9/fontsupport.htm

回答by Mahdi Tahsildari

Change your TextBox with a RichTextBox and it will probably work.
also Default encodingcan be helpful.

使用 RichTextBox 更改您的 TextBox,它可能会起作用。
默认编码可以是有益的。