private void btnAdd_MouseClick(object sender, MouseEventArgs e) { var newDateDue = dtPicker.Value; var addDeadline = cbAddDate.Checked; var newText = rtBox.Text; controller.AddNewTodo(newDateDue, addDeadline, newText); dtPicker.Value = DateTime.Now; cbAddDate.Checked = false; rtBox.Text = ""; controller.todoEnt.SaveChanges(); refreshParentForm.Invoke(); }