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