static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Login login = new Login(); Application.Run(login); if (login.LoginSuccess == true) { Application.Run(new Form_Main()); } }
public Form_Main() { InitializeComponent(); this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form_Main_FormClosing); } private void Form_Main_FormClosing(object sender, FormClosingEventArgs e) { DialogResult dr = MessageBox.Show("Do you REALLY want to close this app?", "Closing event!", MessageBoxButtons.YesNo); if (dr == DialogResult.No) e.Cancel = true; else { e.Cancel = false; Application.Run(new Login()); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)