Ejemplo n.º 1
0
        private void eventDisplay_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            EventForm eventFormInstance = new EventForm(sender);

            eventFormInstance.OnUpdateCalendarHandler += UpdateCalendar;
            eventFormInstance.Visible = true;
        }
        private void lab_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            Label eventClick = (Label)sender;
            int   day        = int.Parse(eventClick.Name.Remove(0, 6));

            if (IsDateBeforeCurrentDate(day))
            {
                MessageBox.Show(@"You cannot set an event in the past.", @"Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                const bool newEvent          = true;
                EventForm  eventFormInstance = new EventForm(day, _selectedDate, newEvent);
                eventFormInstance.OnUpdateCalendarHandler += UpdateCalendar;
                eventFormInstance.Visible = true;
            }
        }