-2

I want to plug in a Spanish or German keyboard and I would like the textbox in my WPF application to recognize the German or Spanish characters.

This can be achieved by changing locale of the system through regional settings and picking up a Spanish or a German keyboard as IME. But I need to change the locale of the system programmatically rather than manually.

3
  • 2
    Can you be a little bit more specific about what you want to achieve?
    – ChrisF
    May 8, 2009 at 8:00
  • What i want to do is to plug a spanish or german keyboard and would like the textbox to recognize the german or spanish characters. This can be achemieved changing locale of the system through regional settings and picking up a spanish or a german keyboard as IME. But i need to change the locale of the system programmatically rather than manually.
    – deepak
    May 8, 2009 at 8:41
  • a really bad example of a question
    – arconaut
    May 8, 2009 at 14:15

2 Answers 2

1

Just a shot in the dark, but there's a Language Property for TextBox.

<TextBox Language="{Binding}">

http://msdn.microsoft.com/en-us/library/system.windows.frameworkelement.language.aspx

So you could bind that Property to a locale attribute in your code.

1

You can use following statement for changing the keyboard language programatically

InputLanguageManager.SetInputLanguage(this, new CultureInfo("en-US"));
                    (Or)
  InputLanguageManager.SetInputLanguage(this, CultureInfo.CreateSpecificCulture("en-US"));

Here you can use any language code instead of en-US

1
  • The question is 4 years old...?
    – Rudi
    Jul 12, 2013 at 10:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.