private void btnXoa_Click(object sender, EventArgs e) { try { DialogResult dialog = MessageBox.Show("Bạn chắc chắn muốn xóa thiết bị này?", "Cảnh báo", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); if (dialog == DialogResult.OK) { tb.XoaThietBI(txtMaTB.Text); MessageBox.Show("Xóa thiết bị được chọn thành công !!"); clear(); hienthi(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }