private void comboLanguage_SelectedIndexChanged(object sender, EventArgs e) { int selx = comboLanguage.SelectedIndex; string langid = ""; switch (selx) { case 0: //langid="hu-HU"; langid = null; break; case 1: langid = "en"; break; } // Remove this event handler because of endless loop raised when // changing language items in comboBox item list // Removing will occur null exception, but can throw out there comboLanguage.SelectedIndexChanged -= comboLanguage_SelectedIndexChanged; if (!string.IsNullOrEmpty(langid)) { LanguageChange chlang = new LanguageChange(); chlang.ChangeLanguage(langid); chlang.ApplyLanguageToForm(this); } // Reimplement this event handler to handle event again comboLanguage.SelectedIndexChanged += comboLanguage_SelectedIndexChanged; }
public SuDokuForm() { InitializeComponent(); #if DEBUG Assembly assembly = Assembly.GetExecutingAssembly(); foreach (string s in assembly.GetManifestResourceNames()) { string xx = s; } #endif chlang = new LanguageChange(); //chlang.ChangeLanguage("hu-HU"); //chlang.ChangeLanguage("en"); chlang.ChangeLanguage(null); // set default language chlang.ApplyLanguageToForm(this); // Init game comboBox for (int ii = 0; ii < Constants.gameDefTb.Length; ii++) { comboGameType.Items.Add(Constants.gameDefTb[ii].gTypeName); } pictureTable.BackColor = Color.DimGray; tableQueue = new TableQueue(); comboGameType.SelectedIndex = 0; gameTimer = new System.Timers.Timer(1000); gameTimer.Elapsed += OnTimedEvent; gameTimer.AutoReset = true; gameTimer.Enabled = true; }