Click here to Skip to main content
15,888,256 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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?
Posted
Updated 26-Mar-13 6:21am
v3

Here is a codeproject article[^] on that subject

and an even better one here[^]
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 26-Mar-13 13:37pm    
We don't know exact TextBox type OP uses; it could be Forms, WPF, etc. I provided a general answer, please see.
—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.).

[EDIT]

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
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900