private void barButtonItem3_ItemClick(object sender, ItemClickEventArgs e)
        {
            DialogResult result = MessageBox.Show("Bạn có muốn đăng xuất không?.", "Thông báo", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);

            if (result == DialogResult.OK)
            {
                this.Hide();
                frmDangNhap fLogin = new frmDangNhap();
                if (fLogin.ShowDialog() == DialogResult.OK)
                {
                    Program.CurrentUser = fLogin.CurrentUser;
                    this.Show();
                }
            }
        }
Example #2
0
        static void Main()
        {
            DevExpress.UserSkins.BonusSkins.Register();
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
            Application.ThreadException += ApplicationThreadException;
            AppDomain.CurrentDomain.UnhandledException += CurrentDomainOnUnhandledException;


            frmDangNhap fLogin = new frmDangNhap();

            if (fLogin.ShowDialog() == DialogResult.OK)
            {
                CurrentUser = fLogin.CurrentUser;
                Application.Run(new frmMain1());
            }
            //else
            //{
            //    Application.Exit();
            //}
        }