Beispiel #1
0
        private void Calendar1_OnDayRefreshed(object sender, CalendarDayEventArgs e)
        {
            CalendarDay calendarDay = e.Day;

            calendarDay.ClearItems();


            if (rnd.Next(1, 100) >= 30)
            {
                calendarDay.AddItem(calendarDay.CurrentDay.AddMinutes(rnd.Next(1, 100)), "Lorem ipsum");
                if (rnd.Next(1, 100) >= 50)
                {
                    calendarDay.AddItem(calendarDay.CurrentDay.AddMinutes(rnd.Next(100, 500)), "Dolor sit amet");
                    if (rnd.Next(1, 100) >= 60)
                    {
                        calendarDay.AddItem(calendarDay.CurrentDay.AddMinutes(rnd.Next(500, 600)), "Consectetur");
                        if (rnd.Next(1, 100) >= 70)
                        {
                            calendarDay.AddItem(calendarDay.CurrentDay.AddMinutes(rnd.Next(600, 900)), "Adipiscing elit");
                            if (rnd.Next(1, 100) >= 80)
                            {
                                calendarDay.AddItem(calendarDay.CurrentDay.AddMinutes(rnd.Next(900, 1400)), "Proin mi libero, tempor sit amet fermentum");
                            }
                        }
                    }
                }
            }
        }
Beispiel #2
0
        public void monthCalendar1_DateSelected(object sender, DateRangeEventArgs e)
        {
            oCalendario.Invalidate();
            oCalendario2.Invalidate();

            oCalendario.SetViewRange(e.Start, e.Start);
            oCalendario.TimeScale = CalendarTimeScale.ThirtyMinutes;

            oCalendario2.SetViewRange(e.Start.AddDays(1), e.Start.AddDays(1));
            oCalendario2.TimeScale = CalendarTimeScale.ThirtyMinutes;

            int Index = 0;

            foreach (CalendarDay oDay in oCalendario.Days)
            {
                if (oDay.Date == monthCalendar1.SelectionEnd.Date)
                {
                    Index = oDay.Index;
                    break;
                }
            }

            System.Windows.Forms.Calendar.CalendarDayEventArgs e2 = new CalendarDayEventArgs(this.oCalendario.Days[Index]);

            oCalendario.EnsureVisible(GetTimeUnit(e2.CalendarDay));


            dateTimePicker1.Value = e.Start;
            dateTimePicker2.Value = e.Start.AddDays(1);

            lblFecha1.Text = dateTimePicker1.Text;
            lblFecha2.Text = dateTimePicker2.Text;
        }
 private void calendar_DayHeaderClick(object sender, CalendarDayEventArgs e)
 {
     calendar.SetViewRange(e.CalendarDay.Date, e.CalendarDay.Date);
     findEventUserControl.SetPickedDateLabel(e.CalendarDay.Date);
     monthView.SelectionStart = e.CalendarDay.Date;
     monthView.SelectionEnd   = e.CalendarDay.Date;
 }
Beispiel #4
0
 void calendar_DayBottomClick(object sender, CalendarDayEventArgs e)
 {
     if (!_contextStripOn)
     {
         _clickedDay = e.CalendarDay.Date;
         contextMenuStrip1.Show(new Point(Cursor.Position.X, Cursor.Position.Y - 30));
         _contextStripOn = true;
     }
     else
     {
         _contextStripOn = false;
         contextMenuStrip1.Hide();
     }
 }
Beispiel #5
0
 void calendar_DayTopClick(object sender, CalendarDayEventArgs e)
 {
     if (!_contextStripOn)
     {
         _clickedDay = e.CalendarDay.Date;
         contextMenuStrip1.Show(Cursor.Position);
         _contextStripOn = true;
     }
     else
     {
         _contextStripOn = false;
         contextMenuStrip1.Hide();
     }
 }
Beispiel #6
0
 void oCalendario2_DayHeaderClick(object sender, CalendarDayEventArgs e)
 {
     oCalendario2.SetViewRange(e.CalendarDay.Date, e.CalendarDay.Date);
     oCalendario2.EnsureVisible(GetTimeUnit(e.CalendarDay));
 }
Beispiel #7
0
 void oCalendario2_OverFlowMouseHover(object sender, CalendarDayEventArgs e)
 {
     //throw new Exception("The method or operation is not implemented.");
 }
Beispiel #8
0
 private void calendar1_DayHeaderClick(object sender, CalendarDayEventArgs e)
 {
     calendar1.SetViewRange(e.CalendarDay.Date, e.CalendarDay.Date);
 }
Beispiel #9
0
 void oCalendario_DayHeaderClick(object sender, CalendarDayEventArgs e)
 {
     //oCalendario.SetViewRange(e.CalendarDay.Date, e.CalendarDay.Date);
     //oCalendario.ScrollTimeUnits(800);
     //oCalendario.EnsureVisible(GetTimeUnit(e.CalendarDay));
 }
Beispiel #10
0
 protected virtual void OnDayHeaderClick(CalendarDayEventArgs e)
 {
     if (DayHeaderClick != null)
     {
         DayHeaderClick(this, e);
     }
 }
Beispiel #11
0
 /// <summary>
 /// specific day click to access specified day only view
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void calendar_DayHeaderClick(object sender, CalendarDayEventArgs e)
 {
     _viewMode = DayViewMode;
     calendar.SetViewRange(e.CalendarDay.Date, e.CalendarDay.Date);
     dayViewButton.Select();
 }