Click here to Skip to main content
15,890,947 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have been beating my head against the preverbal wall trying to figure this out. I have a WPF application targeting .Net 4.5.1 using an MVVM pattern running on Windows 8.1. All I need is to switch the current culture for my application (or all of Windows) so the associated keyboard map is loaded in real-time. I have tried everything I could find on the web, but nothing works correct for what I need. The closest I came is this code:

InputLanguageManager.SetInputLanguage(AcquisitionTextBox, CultureInfo.CreateSpecificCulture(Settings.Default.CurrentCluture));


However, it does not take affect until the view is reloaded. Strangely, it sets the culture/keyboard map for all of windows when it takes effect, not just the specified Textbox.

Would someone help me out with a short example? All I need is a view with three buttons for each installed language, lets say English, Spanish and Norwegian. Arbitrarily clicking any button should switch the current culture and load the associated keyboard layout.

Thanks!

Joe

What I have tried:

InputLanguageManager.SetInputLanguage(AcquisitionTextBox, CultureInfo.CreateSpecificCulture(Settings.Default.CurrentCluture));

and

CultureInfo.DefaultThreadCurrentCulture = new CultureInfo(culture);
CultureInfo.DefaultThreadCurrentUICulture = new CultureInfo(culture);

and

Binding to the TextBox's Language and InputLanguageManager.InputLanguage properties.

and

Everything I could find on Google...
Posted

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