Click here to Skip to main content
15,896,153 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,
I have created a winform with a text box on. The localization of form is True and the language is Urdu. I want to type urdu language in the text box. The RightToLeft has also been set. But when I type, text flows from right to left but it is in english.
I also set the font of the text box with something downloaded from net (urdu font) but it did not work too.
Please help.

Thanks
Posted
Comments
ZurdoDev 10-Feb-12 11:16am    
I could be wrong but I believe it is still going to pick up on your System Settings in Windows.
Sergey Alexandrovich Kryukov 10-Feb-12 11:38am    
Of course! I explain it in detail, please see.
--SA
ZurdoDev 10-Feb-12 11:39am    
As the solution 1 explains, it will still pick up on your system settings, not on your code necessarily.
Sergey Alexandrovich Kryukov 10-Feb-12 11:39am    
What, never uses Urdu or any other non-Latin charset?
--SA

Urdu is very popular and is supported by all modern by default. If you can type in Urdu in any available Windows program, you can type in in you .NET application even RightToLeft is not set. And it has nothing to do with localization. You can type Urdu on any system. (I have no idea what is "localization it true", you don't need it.) Localization is something completely different.

But can you? How did you tell the OS that you switched your keyboard to Urdu? After all, paste some Urdu text in your control; and you will see it works immediately.

First of all, you need to add a language in the Control Panel, "Region and Language", "Keyboard and Languages". Chose a keyboard switch keys in "Advanced Key Settings". But this is something every user of the OS should know, not just a software developer. :-)

As you are using System.Windows.Forms (always tag it in your question, use "Improve question"!), you can also switch input languages using System.Windows.Forms.InputLanguage.CurrentInputLanguage, http://msdn.microsoft.com/en-us/library/system.windows.forms.inputlanguage.currentinputlanguage.aspx[^].

You don't have to do that. I would recommend to rely on the OS only.

By the way, right-to-left and left-to-right is going to be tricky for typing. You can freely mix, say, English and Urdu in one line, as well as any other languages. The direction will be jumping as your type characters from different subsets of Unicode code points.

Please see:
http://unicode.org[^],
http://unicode.org/faq/utf_bom.html[^].

—SA
 
Share this answer
 
Comments
Espen Harlinn 11-Feb-12 5:11am    
5'ed!
Sergey Alexandrovich Kryukov 28-Feb-13 12:14pm    
Thank you, Espen.
—SA
BC @ CV 28-Feb-13 12:14pm    
5'd as well, I learned a few things.
Sergey Alexandrovich Kryukov 28-Feb-13 12:14pm    
Thank you,
—SA
Now you can type / write Urdu in text boxes in VB.NET / ASP.NET / C# / HTML etc. [removed spam links]
 
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