private void toolStripMenuItem18_Click(object sender, EventArgs e) { REGHOTELES.regLocalidad childForm = null; //Barremos las formas que hay en el parent para encontrar la referencia foreach (Form f in this.MdiChildren) { if (f is REGHOTELES.regLocalidad) { childForm = (REGHOTELES.regLocalidad)f; break; } } //Si la encontró ya no necesita la instancia solo la mostramos if (childForm != null) { childForm.Show(); childForm.Focus(); } else { //No se ha creado por lo tanto generamos la instancia childForm = new REGHOTELES.regLocalidad(); childForm.MdiParent = this; childForm.Show(); childForm.Focus(); } }
private void linkRegLocalidad_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { REGHOTELES.regLocalidad x = new REGHOTELES.regLocalidad(); x.Show(); }