I need to fix the English language as input language even if the user selects Arabic keyboard for particular textbox.
Is it possible?
Once I set the input languae as English, it's changing to all textboxes and labels. But I am looking to fix it to English language for a particular textbox only.
Yes, it's possible using the following in the Windows application.
private void textBox2_Enter(object sender, EventArgs e)
{
System.Globalization.CultureInfo TypeOfLanguage = new System.Globalization.CultureInfo("en-us");
InputLanguage.CurrentInputLanguage = InputLanguage.FromCulture(TypeOfLanguage);
}
this.textBox1.KeyDown += new KeyEventHandler(textBox1_KeyDown);
You can add KeyEventHandler
for your textbox, if you are using the WinForms, and analize the KeyDown
event, something like that
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With