private void BtnDongY_Click(object sender, EventArgs e) { String tenNhom = txtTenNhom.Text; if (tenNhom == null || tenNhom == "") { errorProvider.SetError(txtTenNhom, "Vui lòng nhập tên nhóm"); txtTenNhom.Focus(); return; } else { Nhom nhom = Nhom.TimKiem(tenNhom); if (nhom != null) { MessageBox.Show("Tên nhóm đã tồn tại", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { Nhom.Add(tenNhom); //MessageBox.Show("Đã thêm nhóm thành công", "Thông báo", MessageBoxButtons.OK, //MessageBoxIcon.Information); ThongBaoNhom f = new ThongBaoNhom(); f.ShowDialog(); this.Close(); } } }