WinFormTools/WinformGeneralDeveloperFram.../Program.cs

46 lines
1.4 KiB
C#
Raw Normal View History

2021-04-17 15:40:26 +08:00
using DevExpress.Skins;
using DevExpress.UserSkins;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using DevExpress.LookAndFeel;
2021-05-11 08:51:35 +08:00
using Login;
2021-04-25 18:49:28 +08:00
using WinformGeneralDeveloperFrame.Commons;
2021-04-17 15:40:26 +08:00
namespace WinformGeneralDeveloperFrame.Start
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
DevExpress.Skins.SkinManager.EnableFormSkins();
2021-07-02 17:35:46 +08:00
UserLookAndFeel.Default.SetSkinStyle("Office 2007 Silver");
2021-04-17 15:40:26 +08:00
BonusSkins.Register();
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
2021-04-25 18:49:28 +08:00
Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
2021-05-11 08:51:35 +08:00
LoginView dlg = new LoginView();
if (DialogResult.OK == dlg.ShowDialog())
{
if (dlg.bLogin)
{
Application.Run(new MainForm());
}
}
dlg.Dispose();
2021-04-17 15:40:26 +08:00
}
2021-04-25 18:49:28 +08:00
private static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs ex)
{
if (DialogResult.Yes == "系统发生错误,您需要退出系统吗?".ShowYesNoAndError())
{
Application.Exit();
}
}
2021-04-17 15:40:26 +08:00
}
}