Wednesday 15 July 2015

c# - How to change the language of a TextBox automatically -


I have a Winform application in C # and when I get it focused then I have to change a text box.

I tried this code:

  Private zero text box1_Enter (Object Sender, EventArgs e) {SetKeyboardLayout (GetInputLanguageByName ("fa")); } Private Zero Text Box 1_Love (Object Sender, EventArgues E) {SetbackBenLayout (Gaitimton Language Byline ("IND")); } Public Static input language GetInputLanguageByName (string inputname) {foreach (Input language lang in input language. Languages ​​installed languages) {if (lang.Culture.EnglishName.ToLower ().}} Return Null;} Private Zero SetKeyboardLayout (InputLanguage layout) {InputLanguage.CurrentInputLanguage = layout;}   

But when I enter a text box, the language does not change. What can I do? < P>

Things to check:

  1. Is "fa" an established language?
  2. Did you Move text box 1_enter and textbox1 to an event sent by Textbox 1?
  3. Did you run it through the debugger and checked the gateline language and it is said to be the correct language When the focus is achieved and is lost?

No comments:

Post a Comment