コード例 #1
0
        static void Main()
        {
            try
            {
                //Application.ThreadException += new ThreadExceptionEventHandler(UIThreadException);
                //Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
                //AppDomain.CurrentDomain.UnhandledException +=
                //    new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);

                // 虚拟打印机初始化
                VirtualPrint.Init();

                // 列宽控制类初始化
                ColumnWidthControl.Init();

                // 查询过滤器初始化
                QueryFilterControl.Init();

                GlobalObject.GlobalParameter.Init();

                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);

                Application.Run(new FormMain());

                // 保存设置
                ColumnWidthControl.Save();
            }
            catch (Exception exce)
            {
                MessageDialog.ShowErrorMessage(exce.Message);
            }
        }