private void btnDelete_Click(object sender, EventArgs e) { DialogResult result = MessageBox.Show("Are you sure you want to delete current student?", "Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { try { DLL.DeleteAccount(txtID.Text); MessageBox.Show("Successfully Deleted!"); } catch (Exception ex) { MessageBox.Show(ex.Message, "An unexpected error occured while deleting.", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } ClearData(); Disable(); accountManager.Position = 0; } }