private void btnCadastrarSala_Click(object sender, EventArgs e) { VerificaFormAberto(); pnlForm.Visible = true; frmCadastrarSala cadastrarSala = new frmCadastrarSala(); cadastrarSala.TopLevel = false; pnlForm.Controls.Add(cadastrarSala); cadastrarSala.Show(); }
private void btnCadastrarSala_Click(object sender, EventArgs e) { VerificaFormAberto(); frmCadastrarSala cadastrarSala = new frmCadastrarSala(); if (Application.OpenForms.OfType <frmCadastrarSala>().Count() > 0) { Application.OpenForms[cadastrarSala.Name].Focus(); } else { cadastrarSala.Show(); cadastrarSala.DesktopLocation = new Point(629, 288); } }