private void ChangeLanguage(string lang)
{
foreach (Control c in this.Controls)
{
ComponentResourceManager resources = new ComponentResourceManager(typeof(Form1));
resources.ApplyResources(c, c.Name, new CultureInfo(lang));
}
[B]
ComponentResourceManager resourcesss = new ComponentResourceManager(typeof(Form1));
CultureInfo cult = new CultureInfo(lang);
foreach (ToolStripItem m in menuStrip1.Items) //menu.Items)
{
string text = resourcesss.GetString(m.Name + ".Text", cult);
if (text != null)
{
m.Text = text;
}
}
foreach (ToolStripItem co in contextMenuStrip1.Items) //menu.Items)
{
string text = resourcesss.GetString(co.Name + ".Text", cult);
if (text != null)
{
co.Text = text;
}
}
foreach (ToolStripItem t in toolStrip1.Items) //menu.Items)
{
string text = resourcesss.GetString(t.Name + ".Text", cult);
if (text != null)
{
t.Text = text;
}
}[/B]
}