Ejemplo n.º 1
0
        private void BtnAddReminder_Click(object sender, EventArgs e)
        {
            // Add reminder
            if (BtnAddReminder.Text == "Add Reminder")
            {
                if (CBxHours.SelectedIndex != -1 && CBxMinutes.SelectedIndex != -1 && CBxSeconds.SelectedIndex != -1)
                {
                    vReminderSetTime = vHSet + ":" + vMSet + ":" + vSSet + " ";
                    alStoreReminders.Add(vReminderSetTime + RBxReminder.Text);
                    SubUpdateReminders();
                    RBxReminder.Clear();

                    // Reset time entry field
                    CBxHours.SelectedIndex   = -1;
                    CBxMinutes.SelectedIndex = -1;
                    CBxSeconds.SelectedIndex = -1;
                }
                else
                {
                    // Display no time set error message
                    FrmNoTimeSet frmNoTimeSet = new FrmNoTimeSet();
                    frmNoTimeSet.ShowDialog();
                }
            }

            // Allows user to edit reminder
            else if (BtnAddReminder.Text == "Edit Reminder")
            {
                // Stores copy of reminder
                vtmpReminderStore = lblDisplayReminders.Text;

                // recovers reminder to text field
                RBxReminder.Text = vtmpReminderStore;

                // Disables button
                BtnDelteReminder.Enabled = false;

                // Runs subroutine
                SubDeleteReminder();

                // Runs subroutine
                SubUpdateReminders();

                // Changes text button to allow button
                // to perform a different fuction
                BtnAddReminder.Text = "Update Reminder";
            }
            else if (BtnAddReminder.Text == "Update Reminder")
            {
                // Updates reminder with user changes
                RBxReminder.Focus();
                alStoreReminders.Add(RBxReminder.Text);

                // Runs subroutine
                SubUpdateReminders();

                // Clears text field
                RBxReminder.Clear();

                // Changes button text to the
                // original function
                BtnAddReminder.Text = "Add Reminder";

                // Disables buttons
                BtnAddReminder.Enabled   = false;
                BtnDelteReminder.Enabled = false;
            }
        }
Ejemplo n.º 2
0
 private void BtnClearReminderWritten_Click(object sender, EventArgs e)
 {
     // Clears text
     RBxReminder.Clear();
 }