I have made a kiosk application in c# first form has 6 languages (default is english) when i press the spanish button it changes language on the next form but the other forms stay the same
private void btn_esp_Click(object sender, EventArgs e)
{
Thread.CurrentThread.CurrentUICulture = new CultureInfo("es-ES");
ChangeLanguage("es-ES");
this.Hide();
f1.ShowDialog();
this.Close();
f1.DesktopLocation = new Point(100, 100);
}
public void ChangeLanguage(string lang)
{
foreach (Control c in this.Controls)
{
ComponentResourceManager resources = new ComponentResourceManager(typeof(Form1a));
resources.ApplyResources(c, c.Name, new CultureInfo(lang));
foreach (Control child in c.Controls)
{
ComponentResourceManager resources_child = new ComponentResourceManager(typeof(Form1a));
resources_child.ApplyResources(child, child.Name, new CultureInfo(lang));
}
}
}
i am using changeLanguage function in every other form but it does not work