private void btnXoa_Click(object sender, EventArgs e) { DialogResult msg = MessageBox.Show("Có phải bạn muốn xóa " + txtMatang.Text + " " + txtTentang.Text + " không?\r Nếu bạn xóa giá trị này có thể các vị trí ngồi trong khu vực này sẽ bị xóa", "Xóa", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); try { if (msg == DialogResult.OK) { //xóa TangBS bs = new TangBS(); bs.tang_xoaBS(txtMatang.Text); MessageBox.Show("Xóa thành công"); //hiển thị lại txtMatang.Text = ""; txtTentang.Text = ""; load_tang(); txtMatang.Enabled = false; txtTentang.Enabled = false; listView1.Enabled = true; btnThem.Enabled = true; btnXoa.Enabled = false; btnSua.Enabled = false; btnLuu.Enabled = false; btnBoqua.Enabled = false; } } catch { MessageBox.Show("Xảy ra lỗi trong quá trình xóa"); } }