Changing the 'Region and Language' OS setting programmatically
The only solution I managed to implement was to modify the registry. In Windows 7, when the language is changed, a new entry is added to the Registry in the subkey: HKEY_CURRENT_USER\Control Panel\Desktop
. This key will contain the entry PreferredUILanguagesPending
of type REG_MULTI_SZ
and its value will determine the UI language. For the change to be applied the current user needs to log off and log in again. This can be done using the following code:
RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Control Panel\Desktop", true);
string[] lang = {"en-ZA"};
key.SetValue("PreferredUILanguagesPending", lang, RegistryValueKind.MultiString);
The language pack needs to be installed before it can be set. For a list of language packs check here or here. When more than 1 language pack is installed option to change the UI language will appear in Control Panel > Region and Language > Keyboards and Languages > Display language
.
Sounds to me as if changing the Culture/UICulture of your application should be sufficient
e.g.
Thread.CurrentThread.CurrentCulture = new CultureInfo("de-DE");
Thread.CurrentThread.CurrentUICulture = new CultureInfo("de-DE");