static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); UIConexao objfrmConn = new UIConexao(); objfrmConn.ShowDialog(); if (objfrmConn.bConn) { Application.Run(new UIPrincipal(objfrmConn.tbo)); } }
private void mudarAConexãoToolStripMenuItem_Click(object sender, EventArgs e) { foreach (Form frm in this.MdiChildren) { if (frm is UIGerador) { frm.Close(); } } UIConexao uic = new UIConexao(); uic.ShowDialog(); objbo = uic.tbo; toolStripDropDownButton1.Text = objbo.DataBase; if (objbo.DataBase == null) { Application.Exit(); } }