private void metroTile1_Click(object sender, EventArgs e) { if (Application.OpenForms.OfType <ContainerModules>().Count() > 0) { MetroMessageBox.Show(this, "Já há um modulo aberto , feche-o e tente novamente", "Erro", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else { ContainerModules container = new ContainerModules(); container.Show(); container.AddControl(new ModulesControl.ucMorador(), "Morador"); } }
private void tleApartamento_Click(object sender, EventArgs e) { if (Application.OpenForms.OfType <ContainerModules>().Count() > 0) { MetroMessageBox.Show(this, "Já há um modulo aberto , feche-o e tente novamente", "Erro", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else { ContainerModules container = new ContainerModules(); container.Show(); container.AddControl(new Apartamento.ucAptCadastro(), "Apartamento"); } }