using DevExpress.XtraEditors; namespace Verify { internal static class Program { /// /// The main entry point for the application. /// [STAThread] static void Main() { using (var mutex = new System.Threading.Mutex(true, Application.ProductName, out bool createNew)) { if (!createNew) { MessageBox.Show("³ÌÐòÕýÔÚÔËÐÐÖÐ..."); Application.Exit(); return; } } //´¦Àíδ²¶»ñµÄÒì³£ Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); //´¦ÀíUIÏß³ÌÒì³£ Application.ThreadException += (sender, e) => { var ex = e.Exception; XtraMessageBox.Show($"ϵͳ³öÏÖδ֪Òì³££¬ÇëÖØÆôϵͳ£¡\r\n{ex.Message}"); }; //´¦Àí·ÇUIÏß³ÌÒì³£ AppDomain.CurrentDomain.UnhandledException += (sender, e) => { if (e.ExceptionObject is Exception ex) { XtraMessageBox.Show($"ϵͳ³öÏÖδ֪Òì³££¬ÇëÖØÆôϵͳ£¡\r\n{ex.Message}"); } }; Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); // ×ÖÌå var font = new System.Drawing.Font("΢ÈíÑźÚ", 10); DevExpress.XtraEditors.WindowsFormsSettings.DefaultFont = font; DevExpress.XtraEditors.WindowsFormsSettings.DefaultMenuFont = font; DevExpress.Utils.AppearanceObject.DefaultFont = font; //zh-Hans½çÃæ·­Òë System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("zh-Hans"); System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("zh-Hans"); //Ƥ·ô DevExpress.LookAndFeel.UserLookAndFeel.Default.SetSkinStyle(DevExpress.LookAndFeel.SkinStyle.WXICompact); // To customize application configuration such as set high DPI settings or default font, // see https://aka.ms/applicationconfiguration. ApplicationConfiguration.Initialize(); Application.Run(new frmMain()); } } }