static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); loginForm fLogin = new loginForm(); if (fLogin.ShowDialog() == DialogResult.OK) { Application.Run(new mainForm()); } else { Application.Exit(); } }