Click here to Skip to main content
15,921,840 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

In winform I have created one combobox and one textbox, I want while inputing through keyboard, it should be written in Thailand language, but it coming in English language bydefault. Please suggest

Thanks & Regards
Bikram

What I have tried:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ThailandChar
{
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();

foreach(InputLanguage lng in InputLanguage.InstalledInputLanguages)
{
comboBox1.Items.Add(lng.Culture.DisplayName);
}

comboBox1.SelectedIndex = 0;
}

private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
foreach (InputLanguage lng in InputLanguage.InstalledInputLanguages)
{
if (lng.Culture.DisplayName == comboBox1.Text)
{
InputLanguage.CurrentInputLanguage = lng;
}
}

}
}
}
Posted
Updated 30-May-18 11:57am

1 solution

The way to display a language in your control requires (at a minimum) two items:
1) The font has to be available on your system
2) The control's font needs to be set to the font of the language you wish to see.

Really - like using any other font.

Notes:
For certain circumstances, you'll need to create a Font object with your language-font of choice, such as if you wish to print with it.
For certain languages, such as right-to-left reading languages, there are windows has to know how to go right-to-left - that is: KMKB0041: HOWTO: Configure Windows for right-to-left languages such as Arabic, Farsi or Hebrew[^]

Remember - characters on the screen are just drawing - and they application needs to know how to draw them:   the font!
 
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