乌尔都语写作C#中的光标位置 [英] Cursor Position in Urdu Writing C#

查看:84
本文介绍了乌尔都语写作C#中的光标位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Visual Studio 2008,并迫切需要有人教我如何制作乌尔都语应用程序。我想知道如何在TextBox控件中编写Urdu。我使用开源项目来制作应用程序,但现在我需要知道。使用我所做的所有项目,但问题是,一旦按下一个键,光标的位置就会返回一个点。如何迎合这一点?

I am using Visual Studio 2008 and desperately need someone to teach me how to make an Urdu Application. I want to know how exactly to write Urdu in the TextBox Control. I used an open source project for making applications but now I need to know. Using all that I have made a project but the problem is that the position of the cursor goes back one point as soon as a key is pressed. How to cater to that?

推荐答案

这是 codeproject文章 [关于那个问题的^ ]



和一个更好的这里 [ ^ ]


与任何其他语言完全相同。 Urgu很受欢迎,默认情况下在所有系统上都受支持,无需安装任何东西。我的所有系统(不同版本的Windows,Linux)都配置为en-us,但所有CLI应用程序(是的,在Linux上也是如此)支持Urdu;我测试了它,因为我回答了很多类似你的问题。



由于.NET文本支持基于Unicode(内部,在内存中,编码是UTF-16LE),即使在相同的字符串中,也支持大量语言。您只需要确保使用支持字体。字符的字符库可以通过与所有版本的Windows捆绑在一起的字符映射应用程序CHARMAP.EXE进行检查。



没有乌尔都语申请这样的东西。支持多种语言。你不需要做任何特别的事情。



如果你需要在你的UI中支持不同的语言,你需要学习全球化和本地化。实际上,如果你现在的语言只是乌尔都语,我建议你学习它,至少让应用程序全球化。在此步骤中,您只需要避免硬编码数据,将所有字符串(以及更多)保留在嵌入式资源中并开发流畅的UI,而不是根据字符串的长度,如果您在UI设计中使用它们(标签,菜单)等等。







你没有在第一个提到光标问题该语言的版本,并没有完全描述它。你也没有标记你使用的UI库,所以我只会向你解释一般的想法。



你的困难可能与权利有关左写作系统。这已经在Unicode中考虑在内了,因此您可能不需要对此做任何事情。你可以在一个字符串中混合使用从左到右和从右到左的语言,但是在 TextBox 中编辑这样的字符串将是一个特定的挑战,至少对我而言。你只需要习惯它。



然而,如果乌尔都语,或者一些从右到左书写系统发挥主导作用,一些数据编辑或在某个特定时刻在UI中显示,您应该考虑使用控件的RTL属性或其他UI元素。查看相关控件的MSDN帮助页面,并搜索从右到左和RTL成员。阅读相关属性的帮助,它会向您解释如何使用它们。



-SA
In exact same way as any other language. Urgu is popular enough to be supported on all systems by default, without a need to install anything. All my systems (different version of Windows, Linux) are configures as "en-us", but all CLI applications (yes, on Linux, too) supported Urdu; I tested it because I answered many questions like yours.

As .NET text support is based on Unicode (internally, in memory, encoding is UTF-16LE), the big number of languages is supported at the same time, even in the same string. You only need to make sure to use supporting fonts. The character repertoire of fonts could be checked up by the "Character Map" application bundled with all versions of Windows, CHARMAP.EXE.

There is not such thing as "Urdu application". Many languages are supported. You don''t need to do anything special about it.

If you need to support different languages in your UI, you need to learn globalization and localization. Actually, if right now your language is Urdu only, I would advise to learn it anyway and at least keep the application globalized. On this step, you simply need to avoid hard-coding data, keep all strings (and more) in the embedded resources and develop fluid UI, not depending on the lengths of the strings, if you use them in UI design (labels, menus, etc.).



You did not mention the cursor problem in the first version of the language, and did not describe it exactly. You also did not tag the UI library you use, so I''ll only explain you the general idea.

You difficulty might be related to the right-to-left writing system. This is already taken into account in Unicode, so you may not need to do anything about it. You can mix left-to-right and right-to-left languages in one string, but editing such string in a TextBox would be a certain challenge, at least to me. You just need to get used to it.

However, if Urdu, or some right-to-left writing systems is to play the dominant role is some data edited or presented in your UI at some given moment, you should consider using RTL properties of your control or other UI element. Look at the MSDN help pages for the controls in question and search for "right-to-left" and "RTL" members. Read the help in relevant properties, it will explain to you how to use them.

—SA


这篇关于乌尔都语写作C#中的光标位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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