InputLanguage original;
private void textBox1_Enter(object sender, EventArgs e)
{
original = InputLanguage.CurrentInputLanguage;
var culture = System.Globalization.CultureInfo.GetCultureInfo("fa-IR");
var language = InputLanguage.FromCulture(culture);
if (InputLanguage.InstalledInputLanguages.IndexOf(language) >= 0)
InputLanguage.CurrentInputLanguage = language;
else
InputLanguage.CurrentInputLanguage = InputLanguage.DefaultInputLanguage;
}
private void textBox1_Leave(object sender, EventArgs e)
{
InputLanguage.CurrentInputLanguage = original;
}
:منبع
http://stackoverflow.com/questions/35813818/how-to-change-input-language-in-a-windows-forms-application-for-a-specific-contr