Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>IYou should change Thread.CurrentUICulture to match the selected culture. Even though AFAIK if you specify which culture to apply in the ApplyResources method that shouldn´t matter, it does matter for localized strings (eg. for MessageBoxes) and for any other forms loaded thereafter.</p> <p>Also, make sure to also apply new resources to child GroupBox controls, and it works great for me. This would be the code:</p> <pre><code>private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { if (comboBox1.SelectedItem.ToString() == "English") { Thread.CurrentThread.CurrentUICulture = new CultureInfo("en"); ChangeLanguage("en"); } else if (comboBox1.SelectedItem.ToString() == "Spanish") { Thread.CurrentThread.CurrentUICulture = new CultureInfo("es-ES"); ChangeLanguage("es-ES"); } else if (comboBox1.SelectedItem.ToString() == "French") { Thread.CurrentThread.CurrentUICulture = new CultureInfo("fr-FR"); ChangeLanguage("fr-FR"); } } private void ChangeLanguage(string lang) { foreach (Control c in this.Controls) { ComponentResourceManager resources = new ComponentResourceManager(typeof(UserLogin)); resources.ApplyResources(c, c.Name, new CultureInfo(lang)); if (c.ToString().StartsWith("System.Windows.Forms.GroupBox")) { foreach (Control child in c.Controls) { ComponentResourceManager resources_child = new ComponentResourceManager(typeof(UserLogin)); resources_child.ApplyResources(child, child.Name, new CultureInfo(lang)); } } } } </code></pre> <p>Probably will be late for yourself, but I hope it helps someone else if so.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload