private void btnToDoAdd_Click(object sender, EventArgs e) { // Adds the to-do to the lists, displays it on the list box, and increments the 'To-Dos Made' statistic. if (txtToDo.Text != "") { listToDo.Add(txtToDo.Text); txtToDo.Text = ""; UpdateListBoxes(); main.IncrementStat("todo"); } }
private void btnReminderAdd_Click(object sender, EventArgs e) { // Adds the reminder to the lists, displays it on the list box, and increments the 'Reminders Made' statistic. if (txtReminder.Text != "" && dtpickerReminder.Value.AddMinutes(1) > DateTime.Now) { listReminders.Add(dtpickerReminder.Value.ToString("dd/MM/yyyy: ") + txtReminder.Text); txtReminder.Text = ""; AddListElements(); main.IncrementStat("reminder"); } else if (dtpickerReminder.Value.AddMinutes(1) < DateTime.Now) { MessageBox.Show("You cannot add a reminder for a previous date!", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); dtpickerReminder.Value = DateTime.Now; } }