//Método getInstance() public static frmPrincipal getInstance() { if (instance == null) { instance = new frmPrincipal(); } return instance; }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); frmLogin frmLogin = new frmLogin(); frmPrincipal frmPrincipal = new Frames.frmPrincipal(); Application.Run(frmLogin); if (frmLogin.DialogResult == DialogResult.OK) Application.Run(new frmPrincipal()); }
//Método FormClosing private void frmPrincipal_FormClosing(object sender, FormClosingEventArgs e) { instance = null; }