private void btnDelete_Click(object sender, EventArgs e) { string message = "Are you sure you want to delete this task?"; string caption = "Delete Task"; MessageBoxButtons buttons = MessageBoxButtons.YesNo; DialogResult result; result = MessageBox.Show(message, caption, buttons); if (result == DialogResult.Yes) { taskController.DeleteTask(task.TaskId); } }