private void cuadroDeActividadesToolStripMenuItem_Click(object sender, EventArgs e) { if (f1 == null) { f1 = new Form1(); f1.MdiParent = this; f1.FormClosed += new FormClosedEventHandler(f1_FormClosed); f1.Show(); if (fa != null) { fa.Close(); } if (cf != null) { cf.Close(); } if (d != null) { d.Close(); } if (ac != null) { ac.Close(); } if (acerca != null) { acerca.Close(); } } else { f1.Activate(); } }
private void button1_Click(object sender, EventArgs e) { this.Hide(); Form1 f1 = new Form1(); f1.Activate(); f1.Show(); }
static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Form1 form = new Form1(); Thread ct = new Thread( new ThreadStart( // console thread delegate() { while (true) { } })); ct.Start(); // Start console tråden form.Show(); form.Activate(); Application.Run(form); Environment.Exit(0); }