Click here to Skip to main content
15,905,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Give me a solution I want use C# windows application Text box for Tamil language how to create it?
Posted

Actually Windows Forms applications do not need any special code for handling Tamil: they support Unicode. Make sure that you use a font which supports the Tamil characters.
In case you think of a Form with several textboxes, some for input in English, some for input in Tamil, and you would like to ease the input for the user by setting the appropriate input method automatically, you can do as follows:
Add handlers for the Enter and Leave events of a TextBox. In the event handlers, change the InputLanguage acordingly.
On my computer, I did not install Tamil, but e.g. Thai on a German Windows. For changing between Thai and German I can do:
C#
private void txtThai_Leave(object sender, EventArgs e)
{
    ChangeInputLanguage("Deutsch");
}

private void txtThai_Enter(object sender, EventArgs e)
{
    ChangeInputLanguage("Thai");
}

private void ChangeInputLanguage(string languageName)
{
    InputLanguage newLanguage = GetInputLanguageByName(languageName);
    InputLanguage.CurrentInputLanguage = newLanguage;
}

private InputLanguage GetInputLanguageByName(string languageName)
{
    foreach (InputLanguage lang in InputLanguage.InstalledInputLanguages)
    {
        if (lang.LayoutName.ToLower().StartsWith(languageName.ToLower()))
            return lang;
    }
    throw new ApplicationException(string.Format("Requested input language {0} not available", languageName));
}

Replace "Deutsch" and "Thai" with "English" and "Tamil" - and it should work for you.
 
Share this answer
 
Comments
VCSSyed 5-Apr-16 8:51am    
What is this InputLanguage ?
is it any user defined class or built in functions?
I am getting error .can you please give me full code for web application
First you need to have proper font installed for tamil languauge and then set the font in the respective text box:
// Below is example for Hindi font
<asp:textbox id="subject" runat="server" font-names="Arjun" autopostback="True" ontextchanged="subject_TextChanged" xmlns:asp="#unknown">
 
Share this answer
 
for this you have to keep map of your English alphabets & corrosponding tamil letter.
Handle keypress event of Textbox and replace english alphabet with corrosponding tamil character.
for this use google transalter.

e.g.
For A in tamil it is ஒரு

(I dont know about tamil. whether above tamil char corrosponds to A)
 
Share this answer
 
try this


drag& Drop TextBox Your Windows Form then Press F4 For Property Window then set like this
Font -> Tamil Bible
 
Share this answer
 
First You should Understand the Globalization and localization Concept for this..
see this Link..It will help you,I think you reach your requirement to my posted Link

Using Globalization and Localization in ASP.NET[^]
 
Share this answer
 

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