private void cmbSelecionarDisciplina_MouseUp(object sender, MouseEventArgs e) { // Atualiza Combobox Disciplina DisciplinaOp discop = new DisciplinaOp(); cmbSelecionarDisciplina.Items.Clear(); List <string> discs = discop.ProcuraDisciplina(new Disciplina()); foreach (string nomeDisc in discs) { cmbSelecionarDisciplina.Items.Add(nomeDisc); } }
private void cmbDisciplina_MouseUp(object sender, MouseEventArgs e) { // Atualiza Combobox Disciplina DisciplinaOp discop = new DisciplinaOp(); cmbDisciplina.Items.Clear(); try { List <string> discs = discop.ProcuraDisciplina(); foreach (string nomeDisc in discs) { cmbDisciplina.Items.Add(nomeDisc); } } catch (Exception ex) { MessageBox.Show($"Um erro ocorreu.\nMensagem: {ex.Message}", "Atenção"); } }