static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); FormLogin frmLogin = new FormLogin(); if (frmLogin.ShowDialog() == DialogResult.OK) { Application.Run(new FormMain()); } }