VB.net中的汉字控件 [英] Chinese characters in VB.net controls

查看:174
本文介绍了VB.net中的汉字控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我在VB.Net应用程序中尝试显示中文字符时有点挣扎。



我'我正在使用TextBoxes和DataGrids。我正在将中文字形从Excel粘贴到TextBox控件中。所有中文字形都在Excel中正确显示。当粘贴到TextBox中时,大多数中文字形显示正确,但有些不显示,它们显示为占位符框。即使将TextBox设置为与excel相同的字体,也会发生这种情况。



我谷歌搜索这个,我读到Arial Unicode MS对中文字形有一些最好的支持。为什么我不能在设计时为我的TextBox控件选择这个字体,即使它安装在我的系统上?



我在右边跟踪,这只是控件的字体问题?



谢谢,

Kirk

Hello,
I''m struggling a bit trying to display Chinese characters in my VB.Net app.

I''m using TextBoxes and DataGrids. I''m pasting Chinese glyphs over from Excel into the TextBox controls. All the Chinese glyphs show properly in Excel. When pasted into the TextBoxes, most of the Chinese glyphs show properly, but some do not, they show as placeholder boxes. This happens even if the TextBox is set to the same font as excel.

I Googling this, I read that Arial Unicode MS has some of the best support for Chinese glyphs. Why can''t I select this font for my TextBox controls at design-time, even though it''s installed on my system?

Am I on the right track, that this is simply a font issue with the controls?

Thanks,
Kirk

推荐答案

是的,设置正确的字体,特别是Arial Unicode MS,应该可以解决问题。我不知道为什么你没有这样做,因为你没有解释你是如何尝试的。这是非常简单的事情。



要检查什么形式支持字符保留曲目,请使用与所有版本捆绑在一起的应用程序Visual Studio:字符映射(charmap.exe)。



此外,不考虑仅对中文进行硬编码,而是考虑使用全球化和本地化:

http://msdn.microsoft.com /en-us/library/aa292205%28v=vs.71%29.aspx [ ^ ],

http://msdn.microsoft.com/en-us/library/9xdxwwkc%28v=vs.110%29.aspx [< a href =http://msdn.microsoft.com/en-us/library/9xdxwwkc%28v=vs.110%29.aspxtarget =_ blanktitle =New Window> ^ ] 。



-SA
Yes, setting up a proper font, in particular, Arial Unicode MS, should solve the problem. I have no idea why you failed to do that, as you did not explain how you tried. This is really simple thing.

To check up what character repertoire is supported by what form, use the application which is bundled with all versions of Visual Studio: "Character Map" (charmap.exe).

Also, instead of hard-coding UI for just Chinese, consider using globalization and localization instead:
http://msdn.microsoft.com/en-us/library/aa292205%28v=vs.71%29.aspx[^],
http://msdn.microsoft.com/en-us/library/9xdxwwkc%28v=vs.110%29.aspx[^].

—SA


这篇关于VB.net中的汉字控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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