Originariamente inviato da albgen
private void comboBox1_TextChanged(object sender, EventArgs e)
{
string specCult = "";
if (comboBox1.Text.Contains("it-IT"))
specCult = "it-IT";
if (comboBox1.Text.Contains("en-AU"))
specCult = "en-AU";
if (comboBox1.Text.Contains("en-US"))
specCult = "en-US";
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(specCult);
Thread.CurrentThread.CurrentUICulture = new CultureInfo(specCult);
ResourceManager resMgr = new ResourceManager("MyApp", Assembly.GetExecutingAssembly());
System.Reflection.FieldInfo[] fi = this.GetType().GetFields(BindingFlags.Public | BindingFlags.Instance | BindingFlags.NonPublic);
this.Text = resMgr.GetString("frm");
for (int i = 0; i < fi.Length; ++i)
{
FieldInfo info = fi[i];
if ((typeof(Button) == info.FieldType) || (typeof(CheckBox) == info.FieldType) || (typeof(Label) == info.FieldType))
{
Control item = (Control)info.GetValue(this);
item.Text = resMgr.GetString(info.Name);
}
}
}
questo evento è collegato ala combobox che cambia la lingua...
se non capisci qualcosa chiedi...