Click here to Skip to main content
13,300,331 members (51,328 online)
Click here to Skip to main content
Add your own
alternative version


7 bookmarked
Posted 20 Jun 2014

TextBox Accepting Regional Language Input (Malayalam)

, 20 Jun 2014
Rate this:
Please Sign up or sign in to vote.
Making a TextBox accept Regional Language Input (Malayalam)


My attempt here is to give a tip to one of the most asked questions by beginners, "How to make language XXXXX as the input type to a Windows Form control?"


I was developing a Windows Form application where the user input is in my mother tongue "Malayalam", but the issue is the user is not aware of Malayalam keyboard, so he wants a Google Transliteration type input... means the user will type the Malayalam words in English but the system will convert it to the Malayalam format. So I cannot simply set a font to the textbox. I downloaded and installed the Microsoft indic tool for malyalam.

Using the Code

Step 1: First create a Windows Form application with a textbox control in it.

Step 2: The Inputlanguage of the textbox must be Malayalam when the user starts typing and must change back to English when the user input is over. So create two events for Enter and Leave.

private void textBox2_Enter(object sender, EventArgs e)
private void textBox2_Leave(object sender, EventArgs e)

Step 3: Then, create a function to get the installed language:

public static InputLanguage GetInputLanguageByName(string inputName)
    foreach (InputLanguage lang in InputLanguage.InstalledInputLanguages)
        if (lang.Culture.EnglishName.ToLower().StartsWith(inputName))
            return lang;
    return null;

This function will get all the Inputlanguage which has the Name starting with the parameters given to the function.

Step 4: Create a function to set the keyboadlayout to the input language selected.

public void SetKeyboardLayout(InputLanguage layout)
    InputLanguage.CurrentInputLanguage = layout;

Step 5: Finally, call the function inside the Enter and Leave event of the Textbox.

private void textBox2_Enter(object sender, EventArgs e) 
private void textBox2_Leave(object sender, EventArgs e)

Points of Interest

Here, I had used only one textbox control, we can use this in any Winform controls and also many other keyboards are available for free download over the web. So keeping this as a class and passing controls and the inputlanguagename as parameter will help in reducing code irrespective of control and language.


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


About the Author

Software Developer
United Arab Emirates United Arab Emirates
No Biography provided

You may also be interested in...

Comments and Discussions

GeneralMy vote of 5 Pin
deshjibon15-Jul-14 10:36
memberdeshjibon15-Jul-14 10:36 
GeneralMy vote of 5 Pin
ishihidul14-Jul-14 15:57
memberishihidul14-Jul-14 15:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.171207.1 | Last Updated 20 Jun 2014
Article Copyright 2014 by SREENATH GANGA
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid