• <i id='OHgou'><tr id='OHgou'><dt id='OHgou'><q id='OHgou'><span id='OHgou'><b id='OHgou'><form id='OHgou'><ins id='OHgou'></ins><ul id='OHgou'></ul><sub id='OHgou'></sub></form><legend id='OHgou'></legend><bdo id='OHgou'><pre id='OHgou'><center id='OHgou'></center></pre></bdo></b><th id='OHgou'></th></span></q></dt></tr></i><div id='OHgou'><tfoot id='OHgou'></tfoot><dl id='OHgou'><fieldset id='OHgou'></fieldset></dl></div>

    <legend id='OHgou'><style id='OHgou'><dir id='OHgou'><q id='OHgou'></q></dir></style></legend>
    1. <tfoot id='OHgou'></tfoot>

          <bdo id='OHgou'></bdo><ul id='OHgou'></ul>
      1. <small id='OHgou'></small><noframes id='OHgou'>

        Windows 窗体文本框不能粘贴汉字吗

        时间:2023-06-09
      2. <small id='elo8o'></small><noframes id='elo8o'>

            <tfoot id='elo8o'></tfoot><legend id='elo8o'><style id='elo8o'><dir id='elo8o'><q id='elo8o'></q></dir></style></legend>

                • <bdo id='elo8o'></bdo><ul id='elo8o'></ul>

                    <tbody id='elo8o'></tbody>
                • <i id='elo8o'><tr id='elo8o'><dt id='elo8o'><q id='elo8o'><span id='elo8o'><b id='elo8o'><form id='elo8o'><ins id='elo8o'></ins><ul id='elo8o'></ul><sub id='elo8o'></sub></form><legend id='elo8o'></legend><bdo id='elo8o'><pre id='elo8o'><center id='elo8o'></center></pre></bdo></b><th id='elo8o'></th></span></q></dt></tr></i><div id='elo8o'><tfoot id='elo8o'></tfoot><dl id='elo8o'><fieldset id='elo8o'></fieldset></dl></div>
                  本文介绍了Windows 窗体文本框不能粘贴汉字吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在开发一个 WinForm 应用程序,并且我有一个文本框,我在其中粘贴来自 Google 翻译的文本.我在几种 Sematic 和 Indo Languages 中取得了积极的结果,但汉字显示为 Boxes.

                  有什么办法可以克服吗?

                  解决方案

                  您应该使用支持 CJK 编码的适当 Unicode 字体.更好的是Arial Unicode MS",但它可能在没有安装 MS Office 的早于 Vista 的操作系统.在这种情况下,您可以使用其他字体,例如NSimSun".

                  <上一页>string arialUnicodeFontFace = "Arial Unicode MS";字体 unicodeFont = new Font(arialUnicodeFontFace, fontSize);if (unicodeFont.Name != arialUnicodeFontFace)unicodeFont = new Font("NSimSun", fontSize);yourTextBox.Font = unicodeFont;

                  您还可以查看不同 Windows 版本中所有支持的 CJK 字体的列表:http://en.wikipedia.org/wiki/List_of_CJK_fonts

                  I am working on a WinForm App and I have a text box where I am pasting texts from Google Translator. I have got positive results with several Sematic and Indo Languages but Chinese characters appear as Boxes.

                  Is there any way to overcome this?

                  解决方案

                  You should use appropriate Unicode font which supports CJK encodings. The better one is "Arial Unicode MS", but it may be absent on OS earlier than Vista without MS Office installed. In this case you may use another font like "NSimSun".

                  string arialUnicodeFontFace = "Arial Unicode MS";
                  Font unicodeFont = new Font(arialUnicodeFontFace, fontSize);
                  if (unicodeFont.Name != arialUnicodeFontFace)
                      unicodeFont = new Font("NSimSun", fontSize);
                  
                  yourTextBox.Font = unicodeFont;
                  

                  You may also look at the list of all supported CJK fonts in different versions of Windows: http://en.wikipedia.org/wiki/List_of_CJK_fonts

                  这篇关于Windows 窗体文本框不能粘贴汉字吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:在 VB.Net 中使用 Enter 键的 Tab 键功能 下一篇:TextBox-Control 的 MaxLength 属性有多可靠?

                  相关文章

                    <bdo id='3PTz8'></bdo><ul id='3PTz8'></ul>

                  <small id='3PTz8'></small><noframes id='3PTz8'>

                    <legend id='3PTz8'><style id='3PTz8'><dir id='3PTz8'><q id='3PTz8'></q></dir></style></legend>

                  1. <i id='3PTz8'><tr id='3PTz8'><dt id='3PTz8'><q id='3PTz8'><span id='3PTz8'><b id='3PTz8'><form id='3PTz8'><ins id='3PTz8'></ins><ul id='3PTz8'></ul><sub id='3PTz8'></sub></form><legend id='3PTz8'></legend><bdo id='3PTz8'><pre id='3PTz8'><center id='3PTz8'></center></pre></bdo></b><th id='3PTz8'></th></span></q></dt></tr></i><div id='3PTz8'><tfoot id='3PTz8'></tfoot><dl id='3PTz8'><fieldset id='3PTz8'></fieldset></dl></div>
                  2. <tfoot id='3PTz8'></tfoot>