Beispiel #1
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // 初始化区域信息(即配置语言)
            LangUtil.ApplyDefaultLang();

            Application.Run(new Form1());
        }
        private void button1_Click(object sender, EventArgs e)
        {
            LangUtil.SetDefaultLang(comboBox1.SelectedItem.ToString());

            // 询问是否重启
            DialogResult result = MessageBox.Show(
                text: LangResx.Common.DONE + LangResx.Common.RESTART_NOW, caption: "",
                buttons: MessageBoxButtons.YesNo, icon: MessageBoxIcon.Question);

            if (result == DialogResult.Yes)
            {
                Application.Restart();
            }
        }